public final class XmlSchemaUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
XSI_NIL |
| Modifier and Type | Method and Description |
|---|---|
static void |
addImportIfNeeded(XmlSchema schema,
QName qname)
For convenience, start from a qname, and add the import if it is non-null
and has a namespace.
|
static void |
addImportIfNeeded(XmlSchema schema,
java.lang.String namespaceUri)
Assist in managing the required
|
static java.util.List<java.lang.String> |
enumeratorValues(XmlSchemaSimpleType type)
Retrieve the string values for an enumeration.
|
static XmlSchemaElement |
findElementByRefName(SchemaCollection xmlSchemaCollection,
QName name,
java.lang.String referencingURI)
This copes with an observed phenomenon in the schema built by the
ReflectionServiceFactoryBean.
|
static QName |
getBaseType(XmlSchemaComplexType type) |
static java.util.List<XmlSchemaAttributeOrGroupRef> |
getContentAttributes(XmlSchemaComplexType type) |
static java.util.List<XmlSchemaAnnotated> |
getContentAttributes(XmlSchemaComplexType type,
SchemaCollection collection) |
static QName |
getElementQualifiedName(XmlSchemaElement element,
XmlSchema schema)
By convention, an element that is named in its schema's TNS can have a 'name' but
no QName.
|
static boolean |
isAttributeNameQualified(XmlSchemaAttribute attribute,
XmlSchema schema) |
static boolean |
isAttributeQualified(XmlSchemaAttribute attribute,
boolean global,
XmlSchema localSchema,
XmlSchema attributeSchema)
due to a bug, feature, or just plain oddity of JAXB, it isn't good enough
to just check the form of an element and of its schema.
|
static boolean |
isElementNameQualified(XmlSchemaElement element,
XmlSchema schema) |
static boolean |
isElementQualified(XmlSchemaElement element,
boolean global,
XmlSchema localSchema,
XmlSchema elementSchema)
due to a bug, feature, or just plain oddity of JAXB, it isn't good enough
to just check the form of an element and of its schema.
|
static boolean |
isEumeration(XmlSchemaSimpleType type)
Return true if a simple type is a straightforward XML Schema representation of an enumeration.
|
static boolean |
isParticleArray(XmlSchemaParticle particle) |
static boolean |
isParticleOptional(XmlSchemaParticle particle) |
static boolean |
schemaImportsNamespace(XmlSchema schema,
java.lang.String namespaceUri)
Is there an import for a particular namespace in a schema?
|
static void |
setElementRefName(XmlSchemaElement element,
QName name)
Wrapper around XmlSchemaElement.setRefName that checks for inconsistency with
name and QName.
|
public static final java.lang.String XSI_NIL
public static void setElementRefName(XmlSchemaElement element,
QName name)
element - name - public static boolean isEumeration(XmlSchemaSimpleType type)
type - Simple type, possible an enumeration.public static java.util.List<java.lang.String> enumeratorValues(XmlSchemaSimpleType type)
type - public static boolean schemaImportsNamespace(XmlSchema schema,
java.lang.String namespaceUri)
schema - namespaceUri - public static void addImportIfNeeded(XmlSchema schema,
java.lang.String namespaceUri)
schema - namespaceUri - public static void addImportIfNeeded(XmlSchema schema,
QName qname)
schema - qname - addImportIfNeeded(XmlSchema, String)public static XmlSchemaElement findElementByRefName(SchemaCollection xmlSchemaCollection, QName name, java.lang.String referencingURI)
name - referencingURI - public static QName getBaseType(XmlSchemaComplexType type)
public static java.util.List<XmlSchemaAttributeOrGroupRef> getContentAttributes(XmlSchemaComplexType type)
public static java.util.List<XmlSchemaAnnotated> getContentAttributes(XmlSchemaComplexType type,
SchemaCollection collection)
public static QName getElementQualifiedName(XmlSchemaElement element, XmlSchema schema)
element - schema - public static boolean isAttributeNameQualified(XmlSchemaAttribute attribute,
XmlSchema schema)
public static boolean isAttributeQualified(XmlSchemaAttribute attribute,
boolean global,
XmlSchema localSchema,
XmlSchema attributeSchema)
attribute - the attributeglobal - if this element is a global element (complex type ref= to
it, or in a part)localSchema - the schema of the complex type containing the
reference, only used for the 'odd case'.attributeSchema - the schema for the element.public static boolean isElementNameQualified(XmlSchemaElement element,
XmlSchema schema)
public static boolean isElementQualified(XmlSchemaElement element,
boolean global,
XmlSchema localSchema,
XmlSchema elementSchema)
element - the element.global - if this element is a global element (complex type ref= to
it, or in a part)localSchema - the schema of the complex type containing the
reference, only used for the 'odd case'.elementSchema - the schema for the element.public static boolean isParticleArray(XmlSchemaParticle particle)
public static boolean isParticleOptional(XmlSchemaParticle particle)