Package org.frankframework.validation
Class SchemaUtils
java.lang.Object
org.frankframework.validation.SchemaUtils
- Author:
- Michiel Meeuwissen, Jaco de Groot
-
Field Summary
Modifier and TypeFieldDescriptionstatic final QName
static final QName
static final QName
static final QName
protected static final org.apache.logging.log4j.Logger
static final QName
static final QName
static final QName
static final QName
static final QName
static final QName
static final QName
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongroupXsdsByNamespace
(Set<IXSD> xsds, boolean sort) Group a set of XSDs by namespace.static boolean
isElement
(EndElement el, QName... names) Check if the EndElement is one of given qnames.static boolean
isElement
(StartElement el, QName... names) Check if the StartElement is one of given qnames.static boolean
Check if the elementName is one of given qnames.static void
mergeRootXsdsGroupedByNamespaceToSchemasWithIncludes
(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 void
mergeXsdsGroupedByNamespaceToSchemasWithoutIncludes
(IScopeProvider scopeProvider, Map<String, Set<IXSD>> xsdsGroupedByNamespace, XMLStreamWriter xmlStreamWriter) Write merged XSDs to xmlStreamWriter from a map of XSDs grouped by namespace.static void
sortByDependencies
(Set<IXSD> xsds, List<Schema> schemas) static Reader
toReader
(javax.wsdl.Definition wsdlDefinition, javax.wsdl.extensions.schema.Schema wsdlSchema) static String
toString
(javax.wsdl.Definition wsdlDefinition, javax.wsdl.extensions.schema.Schema wsdlSchema) static void
writeStandaloneXsd
(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:
IOException
ConfigurationException
-
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:
XMLStreamException
IOException
ConfigurationException
-
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
-