public interface XSDHelper
Modifier and Type | Field and Description |
---|---|
static XSDHelper |
INSTANCE
The default XSDHelper.
|
Modifier and Type | Method and Description |
---|---|
List |
define(InputStream xsdInputStream,
String schemaLocation)
Define XML Schema as Types.
|
List |
define(Reader xsdReader,
String schemaLocation)
Define XML Schema as Types.
|
List |
define(String xsd)
Define the XML Schema as Types.
|
String |
generate(List types)
Generate an XML Schema Declaration (XSD) from Types.
|
String |
generate(List types,
Map namespaceToSchemaLocation)
Generate an XML Schema Declaration (XSD) from Types.
|
String |
getAppinfo(Property property,
String source)
Return the content of the appinfo declared for this Property and source.
|
String |
getAppinfo(Type type,
String source)
Return the appinfo declared for this Type and source.
|
Property |
getGlobalProperty(String uri,
String propertyName,
boolean isElement)
Returns the Property defined by the named global element or attribute
in the targetNamespace uri, or null if not found.
|
String |
getLocalName(Property property)
Returns the local name as declared in the XSD.
|
String |
getLocalName(Type type)
Returns the local name as declared in the XSD.
|
String |
getNamespaceURI(Property property)
Returns the namespace URI as declared in the XSD.
|
boolean |
isAttribute(Property property)
Returns true if the property is declared as an attribute in the XSD.
|
boolean |
isElement(Property property)
Returns true if the property is declared as an element in the XSD.
|
boolean |
isMixed(Type type)
Returns true if the Type is declared to contain mixed content.
|
boolean |
isXSD(Type type)
Indicates if this helper contains XSD information for the specified type.
|
static final XSDHelper INSTANCE
String getLocalName(Type type)
type
- to return local name for.String getLocalName(Property property)
property
- to return local name for.String getNamespaceURI(Property property)
property
- to return namespace URI for.boolean isAttribute(Property property)
property
- to identify if an attribute.boolean isElement(Property property)
property
- to identify if an element.boolean isMixed(Type type)
type
- to identify if mixed content.boolean isXSD(Type type)
type
- the type.Property getGlobalProperty(String uri, String propertyName, boolean isElement)
uri
- The uri of the targetNamespace.propertyName
- The name of the global property.isElement
- is true for global elements, false for global attributes.String getAppinfo(Type type, String source)
type
- the type with the appinfo declarationsource
- the source of the appinfo declaration.String getAppinfo(Property property, String source)
property
- the Property with the appinfo declarationsource
- the source of the appinfo declaration.List define(String xsd)
xsd
- the XML Schema.IllegalArgumentException
- if the Types could not be defined.List define(Reader xsdReader, String schemaLocation)
xsdReader
- reader to an XML Schema.schemaLocation
- the URI of the location of the schema, used
for processing relative imports and includes. May be null if not used.IllegalArgumentException
- if the Types could not be defined.List define(InputStream xsdInputStream, String schemaLocation)
xsdInputStream
- input stream to an XML Schema.schemaLocation
- the URI of the location of the schema, used
for processing relative imports and includes. May be null if not used.IllegalArgumentException
- if the Types could not be defined.String generate(List types)
types
- a List containing the TypesIllegalArgumentException
- if the XSD could not be generated.String generate(List types, Map namespaceToSchemaLocation)
types
- a List containing the TypesnamespaceToSchemaLocation
- map of target namespace to schema locations or nullIllegalArgumentException
- if the XSD could not be generated.Copyright © 2019 The Apache Software Foundation. All rights reserved.