Interface SchemaType
-
- All Superinterfaces:
SchemaAnnotated
,SchemaComponent
- All Known Implementing Classes:
SchemaTypeImpl
public interface SchemaType extends SchemaComponent, SchemaAnnotated
Represents a schema type.SchemaType is the metadata "type" class for
XmlObject
, and it plays the analogous role forXmlObject
thatClass
plays forObject
.Every XML Bean class corresponds to a singleton SchemaType object obtainable by ClassName.type (e.g.,
XmlNonPositiveInteger.type
), and every XML Bean instance has an actual SchemaType, obtainable byXmlObject.schemaType()
. The ClassName.type and schemaType() mechanisms are analogous to the ordinary Java ClassName.class and obj.getClass() mechanisms.All schema types are represented by a SchemaType, this includes all types regardless of whether they are built-in or user-defined, compiled or uncompiled, simple or complex.
In addition, a compiled XML Bean type system includes special "document" schema types each representing a document containing nothing but a single element for each global element, and special "attribute" schema types each representing a fragment containing nothing but a single global attribute for global attribute.
Do not confuse Schema Types with other types of Schema Components such as
Global Elements
,Global Attributes
,Named Model Groups
, orAttribute Groups
. SchemaType represents a Type component, not any of the other kinds of components. There are different kinds of metadata objects for the different Schema components.The space of SchemaTypes is divided as follows:
- First, there is the universal base type and the universal
subtype. These are
XmlObject.type
(corresponding to xs:anyType) andXmlBeans.NO_TYPE
, respectively. The first type is a base type of all other types. The other type indicates the absence of type information and, at least in set-theoretic terms, is a subtype of all other types. - There is another universal base type that is the base type
for all simple types. This is the
XmlAnySimpleType.type
, corresponding to xs:anySimpleType. Only XmlObject.type and XmlAnySimpleType.type returntrue
forisURType()
, and only XmlBeans.NO_TYPE returnstrue
forisNoType()
. - The two "special" kinds of types that are generated that
do not formally exist in the actual Schema specification are
document types and global attribute types (corresponding to
documents that contain a global element, or fragments that
contain a global attribute). They can be detected using
isDocumentType()
andisAttributeType()
. Other than their anonymity (lack of a type name) and their appearance only at the root of an instance, they are otherwise just like ordinary complex types. - Simple types can be detected using
isSimpleType()
. Complex types are considered to be all the types that are not simple. - Simple types are divided into three varieties: atomic types,
list types, and union types. Which variety of simple type
you have can be discoverd using
getSimpleVariety()
. It will return eitherATOMIC
,LIST
, orUNION
. - An
ATOMIC
simple type is always based on one of the 20 built-in primitive schema types. You can determine the underlying primitive type for an atomic simple type by callinggetPrimitiveType()
. An atomic type may add facet restrictions on top of the primitive type, and these facets can be explored usinggetFacet(int)
,getWhiteSpaceRule()
,matchPatternFacet(java.lang.String)
,getEnumerationValues()
, and related methods. - A
LIST
simple type is always based on another non-list simple type. The underlying list item type can be obtained by usinggetListItemType()
. - A
UNION
simple type is always composed out of a number of other simple types. The direct members of the union can be obtained bygetUnionMemberTypes()
. When unions consist of other unions, it is useful to know useful to know the "leaves of the union tree", so the set of non-union types making up the union can be obtained bygetUnionConstituentTypes()
. The closure of the entire "union tree" isgetUnionSubTypes()
(this includes the type itself). For simple unions that do not consist of other unions, all three of these sets are the same. - Complex types have nested structure. They are divided into
four content types: empty content, simple content, element-only
content, and mixed content. All kinds of complex types may
have attributes. The content type for a complex type can
be dermined using
getContentType()
. This will returnEMPTY_CONTENT
,SIMPLE_CONTENT
,ELEMENT_CONTENT
, orMIXED_CONTENT
. - If a complex type has
EMPTY_CONTENT
, the content model will be null. - If a complex type has
SIMPLE_CONTENT
, then it will extend the simple type that describes the content. In addition, the type may impose additional simple type facet restrictions; these can be determined in the same way they are for a simple type. - If a complex type has
ELEMENT_CONTENT
orMIXED_CONTENT
, then the detailed content model can be determined by examining the particle tree (which may be null for MIXED_CONTENT). The particle tree can be obtained viagetContentModel()
. - When working with a complex type, most users will find it
sufficient to discover the summarized shape of the content model
and attribute model using
getElementProperties()
,getAttributeProperties()
, and related methods rather than examining the particle tree and attribute model directly.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SchemaType.Ref
Used to allow on-demand loading of types.
-
Field Summary
Fields Modifier and Type Field Description static int
ATOMIC
Atomic type.static int
BTC_ANY_SIMPLE
xs:anySimpleType, akaXmlAnySimpleType.type
static int
BTC_ANY_TYPE
xs:anyType, akaXmlObject.type
static int
BTC_ANY_URI
xs:anyURI, akaXmlAnyURI.type
static int
BTC_BASE_64_BINARY
xs:base64Binary, akaXmlBase64Binary.type
static int
BTC_BOOLEAN
xs:boolean, akaXmlBoolean.type
static int
BTC_BYTE
xs:byte, akaXmlByte.type
static int
BTC_DATE
xs:date, akaXmlDate.type
static int
BTC_DATE_TIME
xs:dateTime, akaXmlDateTime.type
static int
BTC_DECIMAL
xs:decimal, akaXmlDecimal.type
static int
BTC_DOUBLE
xs:double, akaXmlDouble.type
static int
BTC_DURATION
xs:duration, akaXmlDuration.type
static int
BTC_ENTITIES
xs:ENTITIES, akaXmlENTITIES.type
static int
BTC_ENTITY
xs:ENTITY, akaXmlENTITY.type
static int
BTC_FIRST_PRIMITIVE
The primitive types have codes between BTC_FIRST_PRIMITIVE and BTC_LAST_PRIMITIVE inclusivestatic int
BTC_FLOAT
xs:float, akaXmlFloat.type
static int
BTC_G_DAY
xs:gDay, akaXmlGDay.type
static int
BTC_G_MONTH
xs:gMonth, akaXmlGMonth.type
static int
BTC_G_MONTH_DAY
xs:gMonthDay, akaXmlGMonthDay.type
static int
BTC_G_YEAR
xs:gYear, akaXmlGYear.type
static int
BTC_G_YEAR_MONTH
xs:gYearMonth, akaXmlGYearMonth.type
static int
BTC_HEX_BINARY
xs:hexBinary, akaXmlBase64Binary.type
static int
BTC_ID
xs:ID, akaXmlID.type
static int
BTC_IDREF
xs:IDREF, akaXmlIDREF.type
static int
BTC_IDREFS
xs:IDREFS, akaXmlIDREFS.type
static int
BTC_INT
xs:int, akaXmlInt.type
static int
BTC_INTEGER
xs:integer, akaXmlInteger.type
static int
BTC_LANGUAGE
xs:language, akaXmlLanguage.type
static int
BTC_LAST_BUILTIN
static int
BTC_LAST_PRIMITIVE
The primitive types have codes between BTC_FIRST_PRIMITIVE and BTC_LAST_PRIMITIVE inclusivestatic int
BTC_LONG
xs:long, akaXmlLong.type
static int
BTC_NAME
xs:Name, akaXmlName.type
static int
BTC_NCNAME
xs:NCName, akaXmlNCName.type
static int
BTC_NEGATIVE_INTEGER
xs:NegativeInteger, akaXmlNegativeInteger.type
static int
BTC_NMTOKEN
xs:NMTOKEN, akaXmlNMTOKEN.type
static int
BTC_NMTOKENS
xs:NMTOKENS, akaXmlNMTOKENS.type
static int
BTC_NON_NEGATIVE_INTEGER
xs:nonNegativeInteger, akaXmlNonNegativeInteger.type
static int
BTC_NON_POSITIVE_INTEGER
xs:nonPositiveInteger, akaXmlNonPositiveInteger.type
static int
BTC_NORMALIZED_STRING
xs:normalizedString, akaXmlNormalizedString.type
static int
BTC_NOT_BUILTIN
Not a builtin typestatic int
BTC_NOTATION
xs:NOTATION, akaXmlNOTATION.type
static int
BTC_POSITIVE_INTEGER
xs:positiveInteger, akaXmlPositiveInteger.type
static int
BTC_QNAME
xs:QName, akaXmlQName.type
static int
BTC_SHORT
xs:short, akaXmlShort.type
static int
BTC_STRING
xs:string, akaXmlString.type
static int
BTC_TIME
xs:time, akaXmlTime.type
static int
BTC_TOKEN
xs:token, akaXmlToken.type
static int
BTC_UNSIGNED_BYTE
xs:unsignedByte, akaXmlUnsignedByte.type
static int
BTC_UNSIGNED_INT
xs:unsignedInt, akaXmlUnsignedInt.type
static int
BTC_UNSIGNED_LONG
xs:unsignedLong, akaXmlUnsignedLong.type
static int
BTC_UNSIGNED_SHORT
xs:unsignedShort, akaXmlUnsignedShort.type
static int
DT_EXTENSION
Derived by extension.static int
DT_NOT_DERIVED
Not derived.static int
DT_RESTRICTION
Derived by restriction.static int
ELEMENT_CONTENT
Element-only content.static int
EMPTY_CONTENT
Empty content.static int
FACET_ENUMERATION
xs:enumeration facet - usegetEnumerationValues()
insteadstatic int
FACET_FRACTION_DIGITS
xs:fractionDigits facetstatic int
FACET_LENGTH
xs:length facetstatic int
FACET_MAX_EXCLUSIVE
xs:maxExclusive facetstatic int
FACET_MAX_INCLUSIVE
xs:maxInclusive facetstatic int
FACET_MAX_LENGTH
xs:maxLength facetstatic int
FACET_MIN_EXCLUSIVE
xs:minExclusive facetstatic int
FACET_MIN_INCLUSIVE
xs:minInclusive facetstatic int
FACET_MIN_LENGTH
xs:minLength facetstatic int
FACET_PATTERN
xs:pattern facet - usematchPatternFacet(java.lang.String)
insteadstatic int
FACET_TOTAL_DIGITS
xs:totalDigits facetstatic int
FACET_WHITE_SPACE
xs:whiteSpace facet - usegetWhiteSpaceRule()
insteadstatic int
LAST_BASIC_FACET
static int
LAST_FACET
The last ordinary facet codestatic int
LAST_PROPERTY
The last property codestatic int
LIST
Simple list type.static int
MIXED_CONTENT
Mixed content.static int
NOT_COMPLEX_TYPE
Not a complex type.static int
NOT_DECIMAL
Not a decimal restriction.static int
NOT_SIMPLE
Not a simple type or simple content.static int
PARTIAL_ORDER
Partially ordered.static int
PROPERTY_BOUNDED
static int
PROPERTY_CARDINALITY
static int
PROPERTY_NUMERIC
static int
PROPERTY_ORDERED
static int
SIMPLE_CONTENT
Simple content.static int
SIZE_BIG_DECIMAL
Fits in aBigDecimal
.static int
SIZE_BIG_INTEGER
Fits in aBigInteger
.static int
SIZE_BYTE
Fits in a byte.static int
SIZE_INT
Fits in an int.static int
SIZE_LONG
Fits in a long.static int
SIZE_SHORT
Fits in a short.static int
TOTAL_ORDER
Totally ordered.static int
UNION
Union type.static int
UNORDERED
Unordered.static int
WS_COLLAPSE
Whitespace collapsed and trimmed.static int
WS_PRESERVE
Whitespace preserved.static int
WS_REPLACE
Whitespace replaced by ordinary space.static int
WS_UNSPECIFIED
Whitespace rule unspecified.-
Fields inherited from interface org.apache.xmlbeans.SchemaComponent
ANNOTATION, ATTRIBUTE, ATTRIBUTE_GROUP, ELEMENT, IDENTITY_CONSTRAINT, MODEL_GROUP, NOTATION, TYPE
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
blockExtension()
True if extensions of this type cannot be substituted for this typeboolean
blockRestriction()
True if restrictions of this type cannot be substituted for this typeSchemaStringEnumEntry
enumEntryForString(java.lang.String s)
Returns the string enum entry corresponding to the given enumerated string, or null if there is no match or this type is not a string enumeration.StringEnumAbstractBase
enumForInt(int i)
Returns the string enum value corresponding to the given enumerated string, or null if there is no match or this type is not a string enumeration.StringEnumAbstractBase
enumForString(java.lang.String s)
Returns the string enum value corresponding to the given enumerated string, or null if there is no match or this type is not a string enumeration.boolean
finalExtension()
True if other types cannot extend this type (only for complex types)boolean
finalList()
True if list derivation of this type is prohibited (only for simple types)boolean
finalRestriction()
True if other types cannot restrict this typeboolean
finalUnion()
True if union derivation of this type is prohibited (only for simple types)SchemaType[]
getAnonymousTypes()
The array of inner (anonymous) types defined within this type.int
getAnonymousUnionMemberOrdinal()
For anonymous types defined inside a union only: gets the integer indicating the declaration order of this type within the outer union type, or zero if this is not applicable.SchemaAttributeModel
getAttributeModel()
Returns the attribute model for this complex type (with simple or complex content).SchemaProperty[]
getAttributeProperties()
Returns all the SchemaProperties corresponding to attributes.SchemaProperty
getAttributeProperty(javax.xml.namespace.QName attrName)
Returns a SchemaProperty corresponding to an attribute within this complex type by looking up the attribute name.SchemaType
getAttributeType(javax.xml.namespace.QName eltName, SchemaTypeLoader wildcardTypeLoader)
Returns the type of an attribute based on the attribute name and the type system within which (wildcard) names are resolved.javax.xml.namespace.QName
getAttributeTypeAttributeName()
Returns the attribute qname if this is a attribute type, or null otherwise.SchemaType
getBaseEnumType()
If this is a string enumeration, returns the most basic base schema type that this enuemration is based on.SchemaType
getBaseType()
Returns base restriction or extension type.int
getBuiltinTypeCode()
Returns an integer for builtin types that can be used for quick comparison.SchemaType
getCommonBaseType(SchemaType type)
Returns common base type with the given type.SchemaField
getContainerField()
The parent schema element.SchemaType
getContentBasedOnType()
For complex types with simple content returns the base type for this type's content.SchemaParticle
getContentModel()
Returns the complex content model for this complex type (with complex content).int
getContentType()
int
getDecimalSize()
For atomic numeric restrictions of decimal only: the numeric size category.int
getDerivationType()
SchemaProperty[]
getDerivedProperties()
Returns the SchemaProperties defined by this complex type, exclusive of the base type (if any).java.lang.String
getDocumentation()
returns user specified documentationjavax.xml.namespace.QName
getDocumentElementName()
Returns the document element name if this is a document type, or null otherwise.SchemaProperty[]
getElementProperties()
Returns all the SchemaProperties corresponding to elements.SchemaProperty
getElementProperty(javax.xml.namespace.QName eltName)
Returns a SchemaProperty corresponding to an element within this complex type by looking up the element name.SchemaTypeElementSequencer
getElementSequencer()
Returns aSchemaTypeElementSequencer
object, which can then be used to validate complex content inside this element.SchemaType
getElementType(javax.xml.namespace.QName eltName, javax.xml.namespace.QName xsiType, SchemaTypeLoader wildcardTypeLoader)
Returns the type of a child element based on the element name and an xsi:type attribute (and the type system within which names are resolved).XmlAnySimpleType[]
getEnumerationValues()
Returns the array of valid objects from the enumeration facet, null if no enumeration defined.java.lang.Class<? extends StringEnumAbstractBase>
getEnumJavaClass()
The Java class corresponding to the enumeration type for this schema type, if applicable (or null if not an enumeration).XmlAnySimpleType
getFacet(int facetCode)
Returns the value of the given facet, or null if none is set.java.lang.String
getFullJavaImplName()
The fully-qualified Java type name of the implementation class.java.lang.String
getFullJavaName()
The fully-qualified Java type name of the class.java.lang.Class<? extends XmlObject>
getJavaClass()
The Java class corresponding to this schema type.SchemaType
getListItemType()
For list types only: get the item type.javax.xml.namespace.QName
getName()
The name used to describe the type in the schema.SchemaType
getOuterType()
The outer schema type.java.lang.String[]
getPatterns()
TrueSchemaType
getPrimitiveType()
For atomic types only: get the primitive type underlying this one.SchemaProperty[]
getProperties()
Returns all the SchemaProperties within this complex type, elements followed by attributes.SchemaType.Ref
getRef()
Retruns a SchemaType.Ref pointing to this schema type itself.java.lang.String
getShortJavaImplName()
The short unqualfiied Java name for the implementation class.java.lang.String
getShortJavaName()
The short unqualfiied Java name for the class.int
getSimpleVariety()
Returns whether the simple type is ATOMIC, UNION, or LIST.SchemaStringEnumEntry[]
getStringEnumEntries()
Returns the array of SchemaStringEnumEntries for this type: this array includes information about the java constant names used for each string enum entry.SchemaTypeSystem
getTypeSystem()
Returns the SchemaTypeLoader in which this type was defined.SchemaType
getUnionCommonBaseType()
For union types only: get the most specific common base type of the constituent member types.SchemaType[]
getUnionConstituentTypes()
For union types only: get the constituent member types.SchemaType[]
getUnionMemberTypes()
For union types only: get the shallow member types.SchemaType[]
getUnionSubTypes()
For union types only: gets the full tree of member types.java.lang.Object
getUserData()
Returns user-specific information.int
getWhiteSpaceRule()
For nonunion simple types: get the whitespace rule.boolean
hasAllContent()
True if the complex content model for this complex type is an "all" group.boolean
hasAttributeWildcards()
True if this type permits wildcard attributes.boolean
hasElementWildcards()
True if this type permits element wildcards.boolean
hasPatternFacet()
True if there are regex pattern facentsboolean
hasStringEnumValues()
True if this is a string enum where an integer is assigned to each enumerated value.boolean
isAbstract()
True if this type cannot be used directly in instancesboolean
isAnonymousType()
True if the Xsd type is anonymous (i.e., not top-level).boolean
isAssignableFrom(SchemaType type)
True if the specified type derives from this type (or if it is the same type).boolean
isAttributeType()
True if this is a attribute type.boolean
isBounded()
True if bounded.boolean
isBuiltinType()
True for any of the 40+ built-in types.boolean
isCompiled()
True if this schema type was compiled to have a corresponding Java class.boolean
isDocumentType()
True if this is a document type.boolean
isFacetFixed(int facetCode)
True if the given facet is fixed.boolean
isFinite()
True if finite.boolean
isNoType()
True for the type object that represents a the absence of a determined type.boolean
isNumeric()
True if numeric.boolean
isOrderSensitive()
True if particles have same defaults, nillability, etc, that are invariant when order changes.boolean
isPrimitiveType()
True for any of the 20 primitive types (plus anySimpleType)boolean
isSimpleType()
True for the anySimpleType and any restrictions/unions/lists.boolean
isSkippedAnonymousType()
True if this anonymous type has no corresponding Java type.boolean
isURType()
True for anyType and anySimpleType.boolean
isValidSubstitution(javax.xml.namespace.QName name)
For document types, true if the given name can be substituted for the document element name.boolean
matchPatternFacet(java.lang.String s)
True if the given string matches the pattern facets.XmlAnySimpleType
newValue(java.lang.Object v)
Creates an immutable simple type value that does not reside in a tree.int
ordered()
True if ordered.QNameSet
qnameSetForWildcardAttributes()
Returns a QNameSet of attributes that may exist in wildcard buchets and are not explicitly defined in this schema type.QNameSet
qnameSetForWildcardElements()
Returns a QNameSet of elements that may exist in wildcard buchets and are not explicitly defined in this schema type.-
Methods inherited from interface org.apache.xmlbeans.SchemaAnnotated
getAnnotation
-
Methods inherited from interface org.apache.xmlbeans.SchemaComponent
getComponentRef, getComponentType, getSourceName
-
-
-
-
Field Detail
-
DT_NOT_DERIVED
static final int DT_NOT_DERIVED
Not derived. True for XmlObject.type only. SeegetDerivationType()
.- See Also:
- Constant Field Values
-
DT_RESTRICTION
static final int DT_RESTRICTION
Derived by restriction. SeegetDerivationType()
.- See Also:
- Constant Field Values
-
DT_EXTENSION
static final int DT_EXTENSION
Derived by extension. SeegetDerivationType()
.- See Also:
- Constant Field Values
-
BTC_NOT_BUILTIN
static final int BTC_NOT_BUILTIN
Not a builtin type- See Also:
- Constant Field Values
-
BTC_ANY_TYPE
static final int BTC_ANY_TYPE
xs:anyType, akaXmlObject.type
- See Also:
- Constant Field Values
-
BTC_FIRST_PRIMITIVE
static final int BTC_FIRST_PRIMITIVE
The primitive types have codes between BTC_FIRST_PRIMITIVE and BTC_LAST_PRIMITIVE inclusive- See Also:
- Constant Field Values
-
BTC_ANY_SIMPLE
static final int BTC_ANY_SIMPLE
xs:anySimpleType, akaXmlAnySimpleType.type
- See Also:
- Constant Field Values
-
BTC_BOOLEAN
static final int BTC_BOOLEAN
xs:boolean, akaXmlBoolean.type
- See Also:
- Constant Field Values
-
BTC_BASE_64_BINARY
static final int BTC_BASE_64_BINARY
xs:base64Binary, akaXmlBase64Binary.type
- See Also:
- Constant Field Values
-
BTC_HEX_BINARY
static final int BTC_HEX_BINARY
xs:hexBinary, akaXmlBase64Binary.type
- See Also:
- Constant Field Values
-
BTC_ANY_URI
static final int BTC_ANY_URI
xs:anyURI, akaXmlAnyURI.type
- See Also:
- Constant Field Values
-
BTC_QNAME
static final int BTC_QNAME
xs:QName, akaXmlQName.type
- See Also:
- Constant Field Values
-
BTC_NOTATION
static final int BTC_NOTATION
xs:NOTATION, akaXmlNOTATION.type
- See Also:
- Constant Field Values
-
BTC_FLOAT
static final int BTC_FLOAT
xs:float, akaXmlFloat.type
- See Also:
- Constant Field Values
-
BTC_DOUBLE
static final int BTC_DOUBLE
xs:double, akaXmlDouble.type
- See Also:
- Constant Field Values
-
BTC_DECIMAL
static final int BTC_DECIMAL
xs:decimal, akaXmlDecimal.type
- See Also:
- Constant Field Values
-
BTC_STRING
static final int BTC_STRING
xs:string, akaXmlString.type
- See Also:
- Constant Field Values
-
BTC_DURATION
static final int BTC_DURATION
xs:duration, akaXmlDuration.type
- See Also:
- Constant Field Values
-
BTC_DATE_TIME
static final int BTC_DATE_TIME
xs:dateTime, akaXmlDateTime.type
- See Also:
- Constant Field Values
-
BTC_TIME
static final int BTC_TIME
xs:time, akaXmlTime.type
- See Also:
- Constant Field Values
-
BTC_DATE
static final int BTC_DATE
xs:date, akaXmlDate.type
- See Also:
- Constant Field Values
-
BTC_G_YEAR_MONTH
static final int BTC_G_YEAR_MONTH
xs:gYearMonth, akaXmlGYearMonth.type
- See Also:
- Constant Field Values
-
BTC_G_YEAR
static final int BTC_G_YEAR
xs:gYear, akaXmlGYear.type
- See Also:
- Constant Field Values
-
BTC_G_MONTH_DAY
static final int BTC_G_MONTH_DAY
xs:gMonthDay, akaXmlGMonthDay.type
- See Also:
- Constant Field Values
-
BTC_G_DAY
static final int BTC_G_DAY
xs:gDay, akaXmlGDay.type
- See Also:
- Constant Field Values
-
BTC_G_MONTH
static final int BTC_G_MONTH
xs:gMonth, akaXmlGMonth.type
- See Also:
- Constant Field Values
-
BTC_LAST_PRIMITIVE
static final int BTC_LAST_PRIMITIVE
The primitive types have codes between BTC_FIRST_PRIMITIVE and BTC_LAST_PRIMITIVE inclusive- See Also:
- Constant Field Values
-
BTC_INTEGER
static final int BTC_INTEGER
xs:integer, akaXmlInteger.type
- See Also:
- Constant Field Values
-
BTC_LONG
static final int BTC_LONG
xs:long, akaXmlLong.type
- See Also:
- Constant Field Values
-
BTC_INT
static final int BTC_INT
xs:int, akaXmlInt.type
- See Also:
- Constant Field Values
-
BTC_SHORT
static final int BTC_SHORT
xs:short, akaXmlShort.type
- See Also:
- Constant Field Values
-
BTC_BYTE
static final int BTC_BYTE
xs:byte, akaXmlByte.type
- See Also:
- Constant Field Values
-
BTC_NON_POSITIVE_INTEGER
static final int BTC_NON_POSITIVE_INTEGER
xs:nonPositiveInteger, akaXmlNonPositiveInteger.type
- See Also:
- Constant Field Values
-
BTC_NEGATIVE_INTEGER
static final int BTC_NEGATIVE_INTEGER
xs:NegativeInteger, akaXmlNegativeInteger.type
- See Also:
- Constant Field Values
-
BTC_NON_NEGATIVE_INTEGER
static final int BTC_NON_NEGATIVE_INTEGER
xs:nonNegativeInteger, akaXmlNonNegativeInteger.type
- See Also:
- Constant Field Values
-
BTC_POSITIVE_INTEGER
static final int BTC_POSITIVE_INTEGER
xs:positiveInteger, akaXmlPositiveInteger.type
- See Also:
- Constant Field Values
-
BTC_UNSIGNED_LONG
static final int BTC_UNSIGNED_LONG
xs:unsignedLong, akaXmlUnsignedLong.type
- See Also:
- Constant Field Values
-
BTC_UNSIGNED_INT
static final int BTC_UNSIGNED_INT
xs:unsignedInt, akaXmlUnsignedInt.type
- See Also:
- Constant Field Values
-
BTC_UNSIGNED_SHORT
static final int BTC_UNSIGNED_SHORT
xs:unsignedShort, akaXmlUnsignedShort.type
- See Also:
- Constant Field Values
-
BTC_UNSIGNED_BYTE
static final int BTC_UNSIGNED_BYTE
xs:unsignedByte, akaXmlUnsignedByte.type
- See Also:
- Constant Field Values
-
BTC_NORMALIZED_STRING
static final int BTC_NORMALIZED_STRING
xs:normalizedString, akaXmlNormalizedString.type
- See Also:
- Constant Field Values
-
BTC_TOKEN
static final int BTC_TOKEN
xs:token, akaXmlToken.type
- See Also:
- Constant Field Values
-
BTC_NAME
static final int BTC_NAME
xs:Name, akaXmlName.type
- See Also:
- Constant Field Values
-
BTC_NCNAME
static final int BTC_NCNAME
xs:NCName, akaXmlNCName.type
- See Also:
- Constant Field Values
-
BTC_LANGUAGE
static final int BTC_LANGUAGE
xs:language, akaXmlLanguage.type
- See Also:
- Constant Field Values
-
BTC_ID
static final int BTC_ID
xs:ID, akaXmlID.type
- See Also:
- Constant Field Values
-
BTC_IDREF
static final int BTC_IDREF
xs:IDREF, akaXmlIDREF.type
- See Also:
- Constant Field Values
-
BTC_IDREFS
static final int BTC_IDREFS
xs:IDREFS, akaXmlIDREFS.type
- See Also:
- Constant Field Values
-
BTC_ENTITY
static final int BTC_ENTITY
xs:ENTITY, akaXmlENTITY.type
- See Also:
- Constant Field Values
-
BTC_ENTITIES
static final int BTC_ENTITIES
xs:ENTITIES, akaXmlENTITIES.type
- See Also:
- Constant Field Values
-
BTC_NMTOKEN
static final int BTC_NMTOKEN
xs:NMTOKEN, akaXmlNMTOKEN.type
- See Also:
- Constant Field Values
-
BTC_NMTOKENS
static final int BTC_NMTOKENS
xs:NMTOKENS, akaXmlNMTOKENS.type
- See Also:
- Constant Field Values
-
BTC_LAST_BUILTIN
static final int BTC_LAST_BUILTIN
- See Also:
- Constant Field Values
-
NOT_COMPLEX_TYPE
static final int NOT_COMPLEX_TYPE
Not a complex type. SeegetContentType()
.- See Also:
- Constant Field Values
-
EMPTY_CONTENT
static final int EMPTY_CONTENT
Empty content. SeegetContentType()
.- See Also:
- Constant Field Values
-
SIMPLE_CONTENT
static final int SIMPLE_CONTENT
Simple content. SeegetContentType()
.- See Also:
- Constant Field Values
-
ELEMENT_CONTENT
static final int ELEMENT_CONTENT
Element-only content. SeegetContentType()
.- See Also:
- Constant Field Values
-
MIXED_CONTENT
static final int MIXED_CONTENT
Mixed content. SeegetContentType()
.- See Also:
- Constant Field Values
-
FACET_LENGTH
static final int FACET_LENGTH
xs:length facet- See Also:
- Constant Field Values
-
FACET_MIN_LENGTH
static final int FACET_MIN_LENGTH
xs:minLength facet- See Also:
- Constant Field Values
-
FACET_MAX_LENGTH
static final int FACET_MAX_LENGTH
xs:maxLength facet- See Also:
- Constant Field Values
-
FACET_MIN_EXCLUSIVE
static final int FACET_MIN_EXCLUSIVE
xs:minExclusive facet- See Also:
- Constant Field Values
-
FACET_MIN_INCLUSIVE
static final int FACET_MIN_INCLUSIVE
xs:minInclusive facet- See Also:
- Constant Field Values
-
FACET_MAX_INCLUSIVE
static final int FACET_MAX_INCLUSIVE
xs:maxInclusive facet- See Also:
- Constant Field Values
-
FACET_MAX_EXCLUSIVE
static final int FACET_MAX_EXCLUSIVE
xs:maxExclusive facet- See Also:
- Constant Field Values
-
FACET_TOTAL_DIGITS
static final int FACET_TOTAL_DIGITS
xs:totalDigits facet- See Also:
- Constant Field Values
-
FACET_FRACTION_DIGITS
static final int FACET_FRACTION_DIGITS
xs:fractionDigits facet- See Also:
- Constant Field Values
-
LAST_BASIC_FACET
static final int LAST_BASIC_FACET
- See Also:
- Constant Field Values
-
FACET_WHITE_SPACE
static final int FACET_WHITE_SPACE
xs:whiteSpace facet - usegetWhiteSpaceRule()
instead- See Also:
- Constant Field Values
-
FACET_PATTERN
static final int FACET_PATTERN
xs:pattern facet - usematchPatternFacet(java.lang.String)
instead- See Also:
- Constant Field Values
-
FACET_ENUMERATION
static final int FACET_ENUMERATION
xs:enumeration facet - usegetEnumerationValues()
instead- See Also:
- Constant Field Values
-
LAST_FACET
static final int LAST_FACET
The last ordinary facet code- See Also:
- Constant Field Values
-
PROPERTY_ORDERED
static final int PROPERTY_ORDERED
- See Also:
ordered()
, Constant Field Values
-
PROPERTY_BOUNDED
static final int PROPERTY_BOUNDED
- See Also:
isBounded()
, Constant Field Values
-
PROPERTY_CARDINALITY
static final int PROPERTY_CARDINALITY
- See Also:
isFinite()
, Constant Field Values
-
PROPERTY_NUMERIC
static final int PROPERTY_NUMERIC
- See Also:
isNumeric()
, Constant Field Values
-
LAST_PROPERTY
static final int LAST_PROPERTY
The last property code- See Also:
- Constant Field Values
-
UNORDERED
static final int UNORDERED
Unordered. Seeordered()
.- See Also:
- Constant Field Values
-
PARTIAL_ORDER
static final int PARTIAL_ORDER
Partially ordered. Seeordered()
.- See Also:
- Constant Field Values
-
TOTAL_ORDER
static final int TOTAL_ORDER
Totally ordered. Seeordered()
.- See Also:
- Constant Field Values
-
NOT_SIMPLE
static final int NOT_SIMPLE
Not a simple type or simple content. SeegetSimpleVariety()
.- See Also:
- Constant Field Values
-
ATOMIC
static final int ATOMIC
Atomic type. SeegetSimpleVariety()
- See Also:
- Constant Field Values
-
UNION
static final int UNION
Union type. SeegetSimpleVariety()
- See Also:
- Constant Field Values
-
LIST
static final int LIST
Simple list type. SeegetSimpleVariety()
- See Also:
- Constant Field Values
-
NOT_DECIMAL
static final int NOT_DECIMAL
Not a decimal restriction. SeegetDecimalSize()
.- See Also:
- Constant Field Values
-
SIZE_BYTE
static final int SIZE_BYTE
Fits in a byte. SeegetDecimalSize()
.- See Also:
- Constant Field Values
-
SIZE_SHORT
static final int SIZE_SHORT
Fits in a short. SeegetDecimalSize()
.- See Also:
- Constant Field Values
-
SIZE_INT
static final int SIZE_INT
Fits in an int. SeegetDecimalSize()
.- See Also:
- Constant Field Values
-
SIZE_LONG
static final int SIZE_LONG
Fits in a long. SeegetDecimalSize()
.- See Also:
- Constant Field Values
-
SIZE_BIG_INTEGER
static final int SIZE_BIG_INTEGER
Fits in aBigInteger
. SeegetDecimalSize()
.- See Also:
- Constant Field Values
-
SIZE_BIG_DECIMAL
static final int SIZE_BIG_DECIMAL
Fits in aBigDecimal
. SeegetDecimalSize()
.- See Also:
- Constant Field Values
-
WS_UNSPECIFIED
static final int WS_UNSPECIFIED
Whitespace rule unspecified. SeegetWhiteSpaceRule()
.- See Also:
- Constant Field Values
-
WS_PRESERVE
static final int WS_PRESERVE
Whitespace preserved. SeegetWhiteSpaceRule()
.- See Also:
- Constant Field Values
-
WS_REPLACE
static final int WS_REPLACE
Whitespace replaced by ordinary space. SeegetWhiteSpaceRule()
.- See Also:
- Constant Field Values
-
WS_COLLAPSE
static final int WS_COLLAPSE
Whitespace collapsed and trimmed. SeegetWhiteSpaceRule()
.- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
javax.xml.namespace.QName getName()
The name used to describe the type in the schema. Null if the type is anonymous (nested), or if it is a document type.- Specified by:
getName
in interfaceSchemaComponent
-
getContainerField
SchemaField getContainerField()
The parent schema element. Null for top-level (named) types and document types.
-
isDocumentType
boolean isDocumentType()
True if this is a document type.Document types are generated for every global element. A document type is an unnamed complex type that contains exactly one element: we define these types, because they are the types of the "documents" which contain the defined global elements, and they all turn into Java types. (Named ElementnameDocument.)
-
isAttributeType
boolean isAttributeType()
True if this is a attribute type.Attribute types are generated for every global attribute. An attribute type is an unnamed complex type that contains exactly one attribute: we define these types, because they are the types of the "attribute documents" which contain the defined global attribute, and they all turn into Java types. (Named AttributenameAttribute.)
-
getDocumentElementName
javax.xml.namespace.QName getDocumentElementName()
Returns the document element name if this is a document type, or null otherwise.
-
getAttributeTypeAttributeName
javax.xml.namespace.QName getAttributeTypeAttributeName()
Returns the attribute qname if this is a attribute type, or null otherwise.
-
getOuterType
SchemaType getOuterType()
The outer schema type. Null for top-level (named) types.
-
isSkippedAnonymousType
boolean isSkippedAnonymousType()
True if this anonymous type has no corresponding Java type. True for anonymous types nested within simple type restrictions.
-
isCompiled
boolean isCompiled()
True if this schema type was compiled to have a corresponding Java class.
-
getFullJavaName
java.lang.String getFullJavaName()
The fully-qualified Java type name of the class.
-
getShortJavaName
java.lang.String getShortJavaName()
The short unqualfiied Java name for the class.
-
getFullJavaImplName
java.lang.String getFullJavaImplName()
The fully-qualified Java type name of the implementation class.
-
getShortJavaImplName
java.lang.String getShortJavaImplName()
The short unqualfiied Java name for the implementation class.
-
getJavaClass
java.lang.Class<? extends XmlObject> getJavaClass()
The Java class corresponding to this schema type.
-
getEnumJavaClass
java.lang.Class<? extends StringEnumAbstractBase> getEnumJavaClass()
The Java class corresponding to the enumeration type for this schema type, if applicable (or null if not an enumeration).
-
getUserData
java.lang.Object getUserData()
Returns user-specific information.- See Also:
SchemaBookmark
-
isAnonymousType
boolean isAnonymousType()
True if the Xsd type is anonymous (i.e., not top-level).
-
isBuiltinType
boolean isBuiltinType()
True for any of the 40+ built-in types.
-
isSimpleType
boolean isSimpleType()
True for the anySimpleType and any restrictions/unions/lists.
-
getBaseType
SchemaType getBaseType()
Returns base restriction or extension type. Unions and lists return the anySimpleType.
-
getCommonBaseType
SchemaType getCommonBaseType(SchemaType type)
Returns common base type with the given type. The returned type is the most specific declared base type of both types.
-
isAssignableFrom
boolean isAssignableFrom(SchemaType type)
True if the specified type derives from this type (or if it is the same type).Note that XmlObject.type (the anyType) is assignable from all type, and the XmlBeans.noType (the absence of a type) is assignable to all types.
-
getDerivationType
int getDerivationType()
-
getBuiltinTypeCode
int getBuiltinTypeCode()
Returns an integer for builtin types that can be used for quick comparison.
-
isURType
boolean isURType()
True for anyType and anySimpleType.
-
isNoType
boolean isNoType()
True for the type object that represents a the absence of a determined type. XML Objects whose type isNoType() are never valid.
-
getTypeSystem
SchemaTypeSystem getTypeSystem()
Returns the SchemaTypeLoader in which this type was defined. Complex types are defined and used in exactly one schema type system, but simple types are defined in one type system and can be used in any number of type systems. The most common case is the builtin types, which are defined in the builtin type system and used elsewhere.- Specified by:
getTypeSystem
in interfaceSchemaComponent
-
isAbstract
boolean isAbstract()
True if this type cannot be used directly in instances
-
finalExtension
boolean finalExtension()
True if other types cannot extend this type (only for complex types)
-
finalRestriction
boolean finalRestriction()
True if other types cannot restrict this type
-
finalList
boolean finalList()
True if list derivation of this type is prohibited (only for simple types)
-
finalUnion
boolean finalUnion()
True if union derivation of this type is prohibited (only for simple types)
-
blockExtension
boolean blockExtension()
True if extensions of this type cannot be substituted for this type
-
blockRestriction
boolean blockRestriction()
True if restrictions of this type cannot be substituted for this type
-
getContentType
int getContentType()
ReturnsEMPTY_CONTENT
,SIMPLE_CONTENT
,ELEMENT_CONTENT
, orMIXED_CONTENT
for complex types. For noncomplex types, returnsNOT_COMPLEX_TYPE
.
-
getContentBasedOnType
SchemaType getContentBasedOnType()
For complex types with simple content returns the base type for this type's content. In most cases, this is the same as the base type, but it can also be an anonymous type.
-
getElementSequencer
SchemaTypeElementSequencer getElementSequencer()
Returns aSchemaTypeElementSequencer
object, which can then be used to validate complex content inside this element. This is useful for example for trying out different names and see which one would be valid as a child of this element.
-
getAnonymousTypes
SchemaType[] getAnonymousTypes()
The array of inner (anonymous) types defined within this type.
-
getElementProperty
SchemaProperty getElementProperty(javax.xml.namespace.QName eltName)
Returns a SchemaProperty corresponding to an element within this complex type by looking up the element name.
-
getElementProperties
SchemaProperty[] getElementProperties()
Returns all the SchemaProperties corresponding to elements.
-
getAttributeProperty
SchemaProperty getAttributeProperty(javax.xml.namespace.QName attrName)
Returns a SchemaProperty corresponding to an attribute within this complex type by looking up the attribute name.
-
getAttributeProperties
SchemaProperty[] getAttributeProperties()
Returns all the SchemaProperties corresponding to attributes.
-
getProperties
SchemaProperty[] getProperties()
Returns all the SchemaProperties within this complex type, elements followed by attributes.
-
getDerivedProperties
SchemaProperty[] getDerivedProperties()
Returns the SchemaProperties defined by this complex type, exclusive of the base type (if any).
-
getAttributeModel
SchemaAttributeModel getAttributeModel()
Returns the attribute model for this complex type (with simple or complex content).
-
hasAttributeWildcards
boolean hasAttributeWildcards()
True if this type permits wildcard attributes. See the attribute model for more information about which wildcards are allowed.
-
getContentModel
SchemaParticle getContentModel()
Returns the complex content model for this complex type (with complex content).
-
hasElementWildcards
boolean hasElementWildcards()
True if this type permits element wildcards. See the content model for more information about which wildcards are allowed, and where.
-
isValidSubstitution
boolean isValidSubstitution(javax.xml.namespace.QName name)
For document types, true if the given name can be substituted for the document element name.
-
hasAllContent
boolean hasAllContent()
True if the complex content model for this complex type is an "all" group.
-
isOrderSensitive
boolean isOrderSensitive()
True if particles have same defaults, nillability, etc, that are invariant when order changes. Computed only for Javaized types.
-
getElementType
SchemaType getElementType(javax.xml.namespace.QName eltName, javax.xml.namespace.QName xsiType, SchemaTypeLoader wildcardTypeLoader)
Returns the type of a child element based on the element name and an xsi:type attribute (and the type system within which names are resolved).
-
getAttributeType
SchemaType getAttributeType(javax.xml.namespace.QName eltName, SchemaTypeLoader wildcardTypeLoader)
Returns the type of an attribute based on the attribute name and the type system within which (wildcard) names are resolved.
-
getFacet
XmlAnySimpleType getFacet(int facetCode)
Returns the value of the given facet, or null if none is set.
-
isFacetFixed
boolean isFacetFixed(int facetCode)
True if the given facet is fixed.
-
ordered
int ordered()
-
isBounded
boolean isBounded()
True if bounded.
-
isFinite
boolean isFinite()
True if finite.
-
isNumeric
boolean isNumeric()
True if numeric.
-
hasPatternFacet
boolean hasPatternFacet()
True if there are regex pattern facents
-
getPatterns
java.lang.String[] getPatterns()
True
-
matchPatternFacet
boolean matchPatternFacet(java.lang.String s)
True if the given string matches the pattern facets. Always true if there are no pattern facets.
-
getEnumerationValues
XmlAnySimpleType[] getEnumerationValues()
Returns the array of valid objects from the enumeration facet, null if no enumeration defined.
-
hasStringEnumValues
boolean hasStringEnumValues()
True if this is a string enum where an integer is assigned to each enumerated value.
-
getBaseEnumType
SchemaType getBaseEnumType()
If this is a string enumeration, returns the most basic base schema type that this enuemration is based on. Otherwise returns null.
-
getStringEnumEntries
SchemaStringEnumEntry[] getStringEnumEntries()
Returns the array of SchemaStringEnumEntries for this type: this array includes information about the java constant names used for each string enum entry.
-
enumEntryForString
SchemaStringEnumEntry enumEntryForString(java.lang.String s)
Returns the string enum entry corresponding to the given enumerated string, or null if there is no match or this type is not a string enumeration.
-
enumForString
StringEnumAbstractBase enumForString(java.lang.String s)
Returns the string enum value corresponding to the given enumerated string, or null if there is no match or this type is not a string enumeration.
-
enumForInt
StringEnumAbstractBase enumForInt(int i)
Returns the string enum value corresponding to the given enumerated string, or null if there is no match or this type is not a string enumeration.
-
isPrimitiveType
boolean isPrimitiveType()
True for any of the 20 primitive types (plus anySimpleType)
-
getSimpleVariety
int getSimpleVariety()
Returns whether the simple type is ATOMIC, UNION, or LIST. ReturnsNOT_SIMPLE
,ATOMIC
,UNION
, orLIST
.
-
getPrimitiveType
SchemaType getPrimitiveType()
For atomic types only: get the primitive type underlying this one.Returns null if this is not an atomic type.
-
getDecimalSize
int getDecimalSize()
For atomic numeric restrictions of decimal only: the numeric size category. Takes into account min and max restrictions as well as totalDigits and fractionDigits facets.Returns either
NOT_DECIMAL
,SIZE_BYTE
,SIZE_SHORT
,SIZE_INT
,SIZE_LONG
,SIZE_BIG_INTEGER
, orSIZE_BIG_DECIMAL
.
-
getUnionMemberTypes
SchemaType[] getUnionMemberTypes()
For union types only: get the shallow member types. This returns the declared member types of the union, so, for example if the type contains another union, the nested members of that union are NOT returned here.Returns null if this type is not a union.
-
getUnionSubTypes
SchemaType[] getUnionSubTypes()
For union types only: gets the full tree of member types. This computes the closure of the set returned by getUnionMemberTypes(), so, for example, it returns all the types nested within unions of unions as well as the top-level members; the set also includes the type itself. If you are seeking only the basic non-union consituents, use getUnionConstituentTypes.Returns null if this type is not a union.
-
getUnionConstituentTypes
SchemaType[] getUnionConstituentTypes()
For union types only: get the constituent member types. This returns only non-union types, so, for example, for unions of unions, this returns the flattened list of individual member types within the innermost unions.Returns null if this type is not a union.
-
getUnionCommonBaseType
SchemaType getUnionCommonBaseType()
For union types only: get the most specific common base type of the constituent member types. May return a UR type.Returns null if this type is not a union.
-
getAnonymousUnionMemberOrdinal
int getAnonymousUnionMemberOrdinal()
For anonymous types defined inside a union only: gets the integer indicating the declaration order of this type within the outer union type, or zero if this is not applicable. The first anonymous union member within a union type is numbered "1". Used to differentiate between different anonymous types.
-
getListItemType
SchemaType getListItemType()
For list types only: get the item type. This is the atomic or union type that is the type of every entry in the list.Returns null if this type is not a list.
-
getWhiteSpaceRule
int getWhiteSpaceRule()
For nonunion simple types: get the whitespace rule. This is eitherWS_PRESERVE
,WS_REPLACE
, orWS_COLLAPSE
. ReturnsWS_UNSPECIFIED
for unions and complex types.
-
newValue
XmlAnySimpleType newValue(java.lang.Object v)
Creates an immutable simple type value that does not reside in a tree.
-
getRef
SchemaType.Ref getRef()
Retruns a SchemaType.Ref pointing to this schema type itself.
-
qnameSetForWildcardElements
QNameSet qnameSetForWildcardElements()
Returns a QNameSet of elements that may exist in wildcard buchets and are not explicitly defined in this schema type. Note: In this example:
the returned QNameSet will not contain the qname of 'someElement'.<xs:complexType name="exampleType"> <xs:sequence> <xs:element name="someElement" type='xs:string' /> <xs:any namespace="##targetNamespace" /> </xs:sequence> </xs:complexType>
- Returns:
- the constructed QNameSet
-
qnameSetForWildcardAttributes
QNameSet qnameSetForWildcardAttributes()
Returns a QNameSet of attributes that may exist in wildcard buchets and are not explicitly defined in this schema type. Note: In this example:
the returned QNameSet will not contain the qname of 'someAttribute'.<xs:complexType name="exampleType"> ... <xs:attribute name='someAttribute' type='xs:string' /> <xs:anyAttribute namespace="##targetNamespace" /> </xs:complexType>
- Returns:
- the constructed QNameSet
-
getDocumentation
java.lang.String getDocumentation()
returns user specified documentation<xs:complexType ...> <xs:annotation> <xs:documentation> getDocumentation method will return whatever stuff here. </xs:docmentation> </xs:annotation> </xs complexType>
-
-