Package org.frankframework.validation
Class SchemaUtils
java.lang.Object
org.frankframework.validation.SchemaUtils
- Author:
- Michiel Meeuwissen, Jaco de Groot
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final QNamestatic final QNamestatic final QNamestatic final QNameprotected static final org.apache.logging.log4j.Loggerstatic final QNamestatic final QNamestatic final QNamestatic final QNamestatic final QNamestatic final QNamestatic final QNamestatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongroupXsdsByNamespace(Set<IXSD> xsds, boolean sort) Group a set of XSDs by namespace.static booleanisElement(EndElement el, QName... names) Check if the EndElement is one of given qnames.static booleanisElement(StartElement el, QName... names) Check if the StartElement is one of given qnames.static booleanCheck if the elementName is one of given qnames.static voidmergeRootXsdsGroupedByNamespaceToSchemasWithIncludes(Map<String, Set<IXSD>> rootXsdsGroupedByNamespace, XMLStreamWriter xmlStreamWriter) mergeXsdsGroupedByNamespaceToSchemasWithoutIncludes(IScopeProvider scopeProvider, Map<String, Set<IXSD>> xsdsGroupedByNamespace) Returns merged XSDs from a map of XSDs grouped by namespace.static voidmergeXsdsGroupedByNamespaceToSchemasWithoutIncludes(IScopeProvider scopeProvider, Map<String, Set<IXSD>> xsdsGroupedByNamespace, XMLStreamWriter xmlStreamWriter) Write merged XSDs to xmlStreamWriter from a map of XSDs grouped by namespace.static voidsortByDependencies(Set<IXSD> xsds, List<Schema> schemas) static ReadertoReader(javax.wsdl.Definition wsdlDefinition, javax.wsdl.extensions.schema.Schema wsdlSchema) static StringtoString(javax.wsdl.Definition wsdlDefinition, javax.wsdl.extensions.schema.Schema wsdlSchema) static voidwriteStandaloneXsd(IXSD xsd, XMLStreamWriter xmlStreamWriter) Write the XSD out to the XMLStreamWriter as a standalone XSD.
-
Field Details
-
LOG
protected static final org.apache.logging.log4j.Logger LOG -
XSD
- See Also:
-
SCHEMA
-
ELEMENT
-
IMPORT
-
INCLUDE
-
REDEFINE
-
TNS
-
ELFORMDEFAULT
-
SCHEMALOCATION
-
NAMESPACE
-
NAME
-
WSDL_SCHEMA
-
-
Constructor Details
-
SchemaUtils
public SchemaUtils()
-
-
Method Details
-
isElement
Check if the StartElement is one of given qnames. -
isElement
Check if the EndElement is one of given qnames. -
isName
Check if the elementName is one of given qnames. -
groupXsdsByNamespace
Group a set of XSDs by namespace. To recursively load all XSDs that are referenced from a starting set of XSDs, first callAbstractXSD.getXsdsRecursive(Set). -
mergeRootXsdsGroupedByNamespaceToSchemasWithIncludes
public static void mergeRootXsdsGroupedByNamespaceToSchemasWithIncludes(Map<String, Set<IXSD>> rootXsdsGroupedByNamespace, XMLStreamWriter xmlStreamWriter) throws XMLStreamException- Throws:
XMLStreamException
-
mergeXsdsGroupedByNamespaceToSchemasWithoutIncludes
public static void mergeXsdsGroupedByNamespaceToSchemasWithoutIncludes(@Nonnull IScopeProvider scopeProvider, @Nonnull Map<String, Set<IXSD>> xsdsGroupedByNamespace, @Nonnull XMLStreamWriter xmlStreamWriter) throws IOException, ConfigurationExceptionWrite merged XSDs to xmlStreamWriter from a map of XSDs grouped by namespace. This map can be created fromgroupXsdsByNamespace(Set, boolean). XSD<xsd:include/>tags will be skipped. To get a complete XSD in the output, callAbstractXSD.getXsdsRecursive(Set)on a set of input-XSDs before grouping them by namespace in a map.- Throws:
IOExceptionConfigurationException
-
mergeXsdsGroupedByNamespaceToSchemasWithoutIncludes
@Nonnull public static Set<IXSD> mergeXsdsGroupedByNamespaceToSchemasWithoutIncludes(IScopeProvider scopeProvider, Map<String, Set<IXSD>> xsdsGroupedByNamespace) throws XMLStreamException, IOException, ConfigurationExceptionReturns merged XSDs from a map of XSDs grouped by namespace. This map can be created fromgroupXsdsByNamespace(Set, boolean). XSD<xsd:include/>tags will be skipped. To get a complete XSD in the output, callAbstractXSD.getXsdsRecursive(Set)on a set of input-XSDs before grouping them by namespace in a map.- Returns:
- merged XSDs
- Throws:
XMLStreamExceptionIOExceptionConfigurationException
-
writeStandaloneXsd
public static void writeStandaloneXsd(@Nonnull IXSD xsd, @Nonnull XMLStreamWriter xmlStreamWriter) throws IOException, ConfigurationException Write the XSD out to the XMLStreamWriter as a standalone XSD.- Parameters:
xsd- XSD to be writtenxmlStreamWriter- Target XMLStreamWriter- Throws:
IOException- When reading or writing failsConfigurationException- When there was an exception in the XML
-
toReader
public static Reader toReader(javax.wsdl.Definition wsdlDefinition, javax.wsdl.extensions.schema.Schema wsdlSchema) throws javax.wsdl.WSDLException - Throws:
javax.wsdl.WSDLException
-
toString
public static String toString(javax.wsdl.Definition wsdlDefinition, javax.wsdl.extensions.schema.Schema wsdlSchema) throws javax.wsdl.WSDLException - Throws:
javax.wsdl.WSDLException
-
sortByDependencies
public static void sortByDependencies(Set<IXSD> xsds, List<Schema> schemas) throws ConfigurationException - Throws:
ConfigurationException
-