Interface SchemaType
- All Superinterfaces:
SchemaAnnotated,SchemaComponent
- All Known Implementing Classes:
SchemaTypeImpl
SchemaType is the metadata "type" class for XmlObject, and it plays the
analogous role for XmlObject that Class plays for
Object.
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 by
XmlObject.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, or Attribute 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 returntrueforisURType(), and only XmlBeans.NO_TYPE returnstrueforisNoType(). - 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
ATOMICsimple 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
LISTsimple type is always based on another non-list simple type. The underlying list item type can be obtained by usinggetListItemType(). - A
UNIONsimple 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_CONTENTorMIXED_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.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classUsed to allow on-demand loading of types. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAtomic type.static final intxs:anySimpleType, akaXmlAnySimpleType.typestatic final intxs:anyType, akaXmlObject.typestatic final intxs:anyURI, akaXmlAnyURI.typestatic final intxs:base64Binary, akaXmlBase64Binary.typestatic final intxs:boolean, akaXmlBoolean.typestatic final intxs:byte, akaXmlByte.typestatic final intxs:date, akaXmlDate.typestatic final intxs:dateTime, akaXmlDateTime.typestatic final intxs:decimal, akaXmlDecimal.typestatic final intxs:double, akaXmlDouble.typestatic final intxs:duration, akaXmlDuration.typestatic final intxs:ENTITIES, akaXmlENTITIES.typestatic final intxs:ENTITY, akaXmlENTITY.typestatic final intThe primitive types have codes between BTC_FIRST_PRIMITIVE and BTC_LAST_PRIMITIVE inclusivestatic final intxs:float, akaXmlFloat.typestatic final intxs:gDay, akaXmlGDay.typestatic final intxs:gMonth, akaXmlGMonth.typestatic final intxs:gMonthDay, akaXmlGMonthDay.typestatic final intxs:gYear, akaXmlGYear.typestatic final intxs:gYearMonth, akaXmlGYearMonth.typestatic final intxs:hexBinary, akaXmlBase64Binary.typestatic final intxs:ID, akaXmlID.typestatic final intxs:IDREF, akaXmlIDREF.typestatic final intxs:IDREFS, akaXmlIDREFS.typestatic final intxs:int, akaXmlInt.typestatic final intxs:integer, akaXmlInteger.typestatic final intxs:language, akaXmlLanguage.typestatic final intstatic final intThe primitive types have codes between BTC_FIRST_PRIMITIVE and BTC_LAST_PRIMITIVE inclusivestatic final intxs:long, akaXmlLong.typestatic final intxs:Name, akaXmlName.typestatic final intxs:NCName, akaXmlNCName.typestatic final intxs:NegativeInteger, akaXmlNegativeInteger.typestatic final intxs:NMTOKEN, akaXmlNMTOKEN.typestatic final intxs:NMTOKENS, akaXmlNMTOKENS.typestatic final intxs:nonNegativeInteger, akaXmlNonNegativeInteger.typestatic final intxs:nonPositiveInteger, akaXmlNonPositiveInteger.typestatic final intxs:normalizedString, akaXmlNormalizedString.typestatic final intNot a builtin typestatic final intxs:NOTATION, akaXmlNOTATION.typestatic final intxs:positiveInteger, akaXmlPositiveInteger.typestatic final intxs:QName, akaXmlQName.typestatic final intxs:short, akaXmlShort.typestatic final intxs:string, akaXmlString.typestatic final intxs:time, akaXmlTime.typestatic final intxs:token, akaXmlToken.typestatic final intxs:unsignedByte, akaXmlUnsignedByte.typestatic final intxs:unsignedInt, akaXmlUnsignedInt.typestatic final intxs:unsignedLong, akaXmlUnsignedLong.typestatic final intxs:unsignedShort, akaXmlUnsignedShort.typestatic final intDerived by extension.static final intNot derived.static final intDerived by restriction.static final intElement-only content.static final intEmpty content.static final intxs:enumeration facet - usegetEnumerationValues()insteadstatic final intxs:fractionDigits facetstatic final intxs:length facetstatic final intxs:maxExclusive facetstatic final intxs:maxInclusive facetstatic final intxs:maxLength facetstatic final intxs:minExclusive facetstatic final intxs:minInclusive facetstatic final intxs:minLength facetstatic final intxs:pattern facet - usematchPatternFacet(java.lang.String)insteadstatic final intxs:totalDigits facetstatic final intxs:whiteSpace facet - usegetWhiteSpaceRule()insteadstatic final intstatic final intThe last ordinary facet codestatic final intThe last property codestatic final intSimple list type.static final intMixed content.static final intNot a complex type.static final intNot a decimal restriction.static final intNot a simple type or simple content.static final intPartially ordered.static final intstatic final intstatic final intstatic final intstatic final intSimple content.static final intFits in aBigDecimal.static final intFits in aBigInteger.static final intFits in a byte.static final intFits in an int.static final intFits in a long.static final intFits in a short.static final intTotally ordered.static final intUnion type.static final intUnordered.static final intWhitespace collapsed and trimmed.static final intWhitespace preserved.static final intWhitespace replaced by ordinary space.static final intWhitespace rule unspecified.Fields inherited from interface org.apache.xmlbeans.SchemaComponent
ANNOTATION, ATTRIBUTE, ATTRIBUTE_GROUP, ELEMENT, IDENTITY_CONSTRAINT, MODEL_GROUP, NOTATION, TYPE -
Method Summary
Modifier and TypeMethodDescriptionbooleanTrue if extensions of this type cannot be substituted for this typebooleanTrue if restrictions of this type cannot be substituted for this typeReturns 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.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.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.booleanTrue if other types cannot extend this type (only for complex types)booleanTrue if list derivation of this type is prohibited (only for simple types)booleanTrue if other types cannot restrict this typebooleanTrue if union derivation of this type is prohibited (only for simple types)The array of inner (anonymous) types defined within this type.intFor 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.Returns the attribute model for this complex type (with simple or complex content).Returns all the SchemaProperties corresponding to attributes.getAttributeProperty(QName attrName) Returns a SchemaProperty corresponding to an attribute within this complex type by looking up the attribute name.getAttributeType(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.Returns the attribute qname if this is a attribute type, or null otherwise.If this is a string enumeration, returns the most basic base schema type that this enuemration is based on.Returns base restriction or extension type.intReturns an integer for builtin types that can be used for quick comparison.getCommonBaseType(SchemaType type) Returns common base type with the given type.The parent schema element.For complex types with simple content returns the base type for this type's content.Returns the complex content model for this complex type (with complex content).intintFor atomic numeric restrictions of decimal only: the numeric size category.intReturns the SchemaProperties defined by this complex type, exclusive of the base type (if any).returns user specified documentationReturns the document element name if this is a document type, or null otherwise.Returns all the SchemaProperties corresponding to elements.getElementProperty(QName eltName) Returns a SchemaProperty corresponding to an element within this complex type by looking up the element name.Returns aSchemaTypeElementSequencerobject, which can then be used to validate complex content inside this element.getElementType(QName eltName, 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).Returns the array of valid objects from the enumeration facet, null if no enumeration defined.Class<? extends StringEnumAbstractBase> The Java class corresponding to the enumeration type for this schema type, if applicable (or null if not an enumeration).getFacet(int facetCode) Returns the value of the given facet, or null if none is set.The fully-qualified Java type name of the implementation class.The fully-qualified Java type name of the class.The Java class corresponding to this schema type.For list types only: get the item type.getName()The name used to describe the type in the schema.The outer schema type.String[]TrueFor atomic types only: get the primitive type underlying this one.Returns all the SchemaProperties within this complex type, elements followed by attributes.getRef()Retruns a SchemaType.Ref pointing to this schema type itself.The short unqualfiied Java name for the implementation class.The short unqualfiied Java name for the class.intReturns whether the simple type is ATOMIC, UNION, or LIST.Returns the array of SchemaStringEnumEntries for this type: this array includes information about the java constant names used for each string enum entry.Returns the SchemaTypeLoader in which this type was defined.For union types only: get the most specific common base type of the constituent member types.For union types only: get the constituent member types.For union types only: get the shallow member types.For union types only: gets the full tree of member types.Returns user-specific information.intFor nonunion simple types: get the whitespace rule.booleanTrue if the complex content model for this complex type is an "all" group.booleanTrue if this type permits wildcard attributes.booleanTrue if this type permits element wildcards.booleanTrue if there are regex pattern facentsbooleanTrue if this is a string enum where an integer is assigned to each enumerated value.booleanTrue if this type cannot be used directly in instancesbooleanTrue if the Xsd type is anonymous (i.e., not top-level).booleanisAssignableFrom(SchemaType type) True if the specified type derives from this type (or if it is the same type).booleanTrue if this is a attribute type.booleanTrue if bounded.booleanTrue for any of the 40+ built-in types.booleanTrue if this schema type was compiled to have a corresponding Java class.booleanTrue if this is a document type.booleanisFacetFixed(int facetCode) True if the given facet is fixed.booleanisFinite()True if finite.booleanisNoType()True for the type object that represents a the absence of a determined type.booleanTrue if numeric.booleanTrue if particles have same defaults, nillability, etc, that are invariant when order changes.booleanTrue for any of the 20 primitive types (plus anySimpleType)booleanTrue for the anySimpleType and any restrictions/unions/lists.booleanTrue if this anonymous type has no corresponding Java type.booleanisURType()True for anyType and anySimpleType.booleanisValidSubstitution(QName name) For document types, true if the given name can be substituted for the document element name.booleanTrue if the given string matches the pattern facets.Creates an immutable simple type value that does not reside in a tree.intordered()True if ordered.Returns a QNameSet of attributes that may exist in wildcard buchets and are not explicitly defined in this schema type.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
getAnnotationMethods inherited from interface org.apache.xmlbeans.SchemaComponent
getComponentRef, getComponentType, getSourceName
-
Field Details
-
DT_NOT_DERIVED
static final int DT_NOT_DERIVEDNot derived. True for XmlObject.type only. SeegetDerivationType().- See Also:
-
DT_RESTRICTION
static final int DT_RESTRICTIONDerived by restriction. SeegetDerivationType().- See Also:
-
DT_EXTENSION
static final int DT_EXTENSIONDerived by extension. SeegetDerivationType().- See Also:
-
BTC_NOT_BUILTIN
static final int BTC_NOT_BUILTINNot a builtin type- See Also:
-
BTC_ANY_TYPE
static final int BTC_ANY_TYPExs:anyType, akaXmlObject.type- See Also:
-
BTC_FIRST_PRIMITIVE
static final int BTC_FIRST_PRIMITIVEThe primitive types have codes between BTC_FIRST_PRIMITIVE and BTC_LAST_PRIMITIVE inclusive- See Also:
-
BTC_ANY_SIMPLE
static final int BTC_ANY_SIMPLExs:anySimpleType, akaXmlAnySimpleType.type- See Also:
-
BTC_BOOLEAN
static final int BTC_BOOLEANxs:boolean, akaXmlBoolean.type- See Also:
-
BTC_BASE_64_BINARY
static final int BTC_BASE_64_BINARYxs:base64Binary, akaXmlBase64Binary.type- See Also:
-
BTC_HEX_BINARY
static final int BTC_HEX_BINARYxs:hexBinary, akaXmlBase64Binary.type- See Also:
-
BTC_ANY_URI
static final int BTC_ANY_URIxs:anyURI, akaXmlAnyURI.type- See Also:
-
BTC_QNAME
static final int BTC_QNAMExs:QName, akaXmlQName.type- See Also:
-
BTC_NOTATION
static final int BTC_NOTATIONxs:NOTATION, akaXmlNOTATION.type- See Also:
-
BTC_FLOAT
static final int BTC_FLOATxs:float, akaXmlFloat.type- See Also:
-
BTC_DOUBLE
static final int BTC_DOUBLExs:double, akaXmlDouble.type- See Also:
-
BTC_DECIMAL
static final int BTC_DECIMALxs:decimal, akaXmlDecimal.type- See Also:
-
BTC_STRING
static final int BTC_STRINGxs:string, akaXmlString.type- See Also:
-
BTC_DURATION
static final int BTC_DURATIONxs:duration, akaXmlDuration.type- See Also:
-
BTC_DATE_TIME
static final int BTC_DATE_TIMExs:dateTime, akaXmlDateTime.type- See Also:
-
BTC_TIME
static final int BTC_TIMExs:time, akaXmlTime.type- See Also:
-
BTC_DATE
static final int BTC_DATExs:date, akaXmlDate.type- See Also:
-
BTC_G_YEAR_MONTH
static final int BTC_G_YEAR_MONTHxs:gYearMonth, akaXmlGYearMonth.type- See Also:
-
BTC_G_YEAR
static final int BTC_G_YEARxs:gYear, akaXmlGYear.type- See Also:
-
BTC_G_MONTH_DAY
static final int BTC_G_MONTH_DAYxs:gMonthDay, akaXmlGMonthDay.type- See Also:
-
BTC_G_DAY
static final int BTC_G_DAYxs:gDay, akaXmlGDay.type- See Also:
-
BTC_G_MONTH
static final int BTC_G_MONTHxs:gMonth, akaXmlGMonth.type- See Also:
-
BTC_LAST_PRIMITIVE
static final int BTC_LAST_PRIMITIVEThe primitive types have codes between BTC_FIRST_PRIMITIVE and BTC_LAST_PRIMITIVE inclusive- See Also:
-
BTC_INTEGER
static final int BTC_INTEGERxs:integer, akaXmlInteger.type- See Also:
-
BTC_LONG
static final int BTC_LONGxs:long, akaXmlLong.type- See Also:
-
BTC_INT
static final int BTC_INTxs:int, akaXmlInt.type- See Also:
-
BTC_SHORT
static final int BTC_SHORTxs:short, akaXmlShort.type- See Also:
-
BTC_BYTE
static final int BTC_BYTExs:byte, akaXmlByte.type- See Also:
-
BTC_NON_POSITIVE_INTEGER
static final int BTC_NON_POSITIVE_INTEGERxs:nonPositiveInteger, akaXmlNonPositiveInteger.type- See Also:
-
BTC_NEGATIVE_INTEGER
static final int BTC_NEGATIVE_INTEGERxs:NegativeInteger, akaXmlNegativeInteger.type- See Also:
-
BTC_NON_NEGATIVE_INTEGER
static final int BTC_NON_NEGATIVE_INTEGERxs:nonNegativeInteger, akaXmlNonNegativeInteger.type- See Also:
-
BTC_POSITIVE_INTEGER
static final int BTC_POSITIVE_INTEGERxs:positiveInteger, akaXmlPositiveInteger.type- See Also:
-
BTC_UNSIGNED_LONG
static final int BTC_UNSIGNED_LONGxs:unsignedLong, akaXmlUnsignedLong.type- See Also:
-
BTC_UNSIGNED_INT
static final int BTC_UNSIGNED_INTxs:unsignedInt, akaXmlUnsignedInt.type- See Also:
-
BTC_UNSIGNED_SHORT
static final int BTC_UNSIGNED_SHORTxs:unsignedShort, akaXmlUnsignedShort.type- See Also:
-
BTC_UNSIGNED_BYTE
static final int BTC_UNSIGNED_BYTExs:unsignedByte, akaXmlUnsignedByte.type- See Also:
-
BTC_NORMALIZED_STRING
static final int BTC_NORMALIZED_STRINGxs:normalizedString, akaXmlNormalizedString.type- See Also:
-
BTC_TOKEN
static final int BTC_TOKENxs:token, akaXmlToken.type- See Also:
-
BTC_NAME
static final int BTC_NAMExs:Name, akaXmlName.type- See Also:
-
BTC_NCNAME
static final int BTC_NCNAMExs:NCName, akaXmlNCName.type- See Also:
-
BTC_LANGUAGE
static final int BTC_LANGUAGExs:language, akaXmlLanguage.type- See Also:
-
BTC_ID
static final int BTC_IDxs:ID, akaXmlID.type- See Also:
-
BTC_IDREF
static final int BTC_IDREFxs:IDREF, akaXmlIDREF.type- See Also:
-
BTC_IDREFS
static final int BTC_IDREFSxs:IDREFS, akaXmlIDREFS.type- See Also:
-
BTC_ENTITY
static final int BTC_ENTITYxs:ENTITY, akaXmlENTITY.type- See Also:
-
BTC_ENTITIES
static final int BTC_ENTITIESxs:ENTITIES, akaXmlENTITIES.type- See Also:
-
BTC_NMTOKEN
static final int BTC_NMTOKENxs:NMTOKEN, akaXmlNMTOKEN.type- See Also:
-
BTC_NMTOKENS
static final int BTC_NMTOKENSxs:NMTOKENS, akaXmlNMTOKENS.type- See Also:
-
BTC_LAST_BUILTIN
static final int BTC_LAST_BUILTIN- See Also:
-
NOT_COMPLEX_TYPE
static final int NOT_COMPLEX_TYPENot a complex type. SeegetContentType().- See Also:
-
EMPTY_CONTENT
static final int EMPTY_CONTENTEmpty content. SeegetContentType().- See Also:
-
SIMPLE_CONTENT
static final int SIMPLE_CONTENTSimple content. SeegetContentType().- See Also:
-
ELEMENT_CONTENT
static final int ELEMENT_CONTENTElement-only content. SeegetContentType().- See Also:
-
MIXED_CONTENT
static final int MIXED_CONTENTMixed content. SeegetContentType().- See Also:
-
FACET_LENGTH
static final int FACET_LENGTHxs:length facet- See Also:
-
FACET_MIN_LENGTH
static final int FACET_MIN_LENGTHxs:minLength facet- See Also:
-
FACET_MAX_LENGTH
static final int FACET_MAX_LENGTHxs:maxLength facet- See Also:
-
FACET_MIN_EXCLUSIVE
static final int FACET_MIN_EXCLUSIVExs:minExclusive facet- See Also:
-
FACET_MIN_INCLUSIVE
static final int FACET_MIN_INCLUSIVExs:minInclusive facet- See Also:
-
FACET_MAX_INCLUSIVE
static final int FACET_MAX_INCLUSIVExs:maxInclusive facet- See Also:
-
FACET_MAX_EXCLUSIVE
static final int FACET_MAX_EXCLUSIVExs:maxExclusive facet- See Also:
-
FACET_TOTAL_DIGITS
static final int FACET_TOTAL_DIGITSxs:totalDigits facet- See Also:
-
FACET_FRACTION_DIGITS
static final int FACET_FRACTION_DIGITSxs:fractionDigits facet- See Also:
-
LAST_BASIC_FACET
static final int LAST_BASIC_FACET- See Also:
-
FACET_WHITE_SPACE
static final int FACET_WHITE_SPACExs:whiteSpace facet - usegetWhiteSpaceRule()instead- See Also:
-
FACET_PATTERN
static final int FACET_PATTERNxs:pattern facet - usematchPatternFacet(java.lang.String)instead- See Also:
-
FACET_ENUMERATION
static final int FACET_ENUMERATIONxs:enumeration facet - usegetEnumerationValues()instead- See Also:
-
LAST_FACET
static final int LAST_FACETThe last ordinary facet code- See Also:
-
PROPERTY_ORDERED
static final int PROPERTY_ORDERED- See Also:
-
PROPERTY_BOUNDED
static final int PROPERTY_BOUNDED- See Also:
-
PROPERTY_CARDINALITY
static final int PROPERTY_CARDINALITY- See Also:
-
PROPERTY_NUMERIC
static final int PROPERTY_NUMERIC- See Also:
-
LAST_PROPERTY
static final int LAST_PROPERTYThe last property code- See Also:
-
UNORDERED
static final int UNORDEREDUnordered. Seeordered().- See Also:
-
PARTIAL_ORDER
static final int PARTIAL_ORDERPartially ordered. Seeordered().- See Also:
-
TOTAL_ORDER
static final int TOTAL_ORDERTotally ordered. Seeordered().- See Also:
-
NOT_SIMPLE
static final int NOT_SIMPLENot a simple type or simple content. SeegetSimpleVariety().- See Also:
-
ATOMIC
static final int ATOMICAtomic type. SeegetSimpleVariety()- See Also:
-
UNION
static final int UNIONUnion type. SeegetSimpleVariety()- See Also:
-
LIST
static final int LISTSimple list type. SeegetSimpleVariety()- See Also:
-
NOT_DECIMAL
static final int NOT_DECIMALNot a decimal restriction. SeegetDecimalSize().- See Also:
-
SIZE_BYTE
static final int SIZE_BYTEFits in a byte. SeegetDecimalSize().- See Also:
-
SIZE_SHORT
static final int SIZE_SHORTFits in a short. SeegetDecimalSize().- See Also:
-
SIZE_INT
static final int SIZE_INTFits in an int. SeegetDecimalSize().- See Also:
-
SIZE_LONG
static final int SIZE_LONGFits in a long. SeegetDecimalSize().- See Also:
-
SIZE_BIG_INTEGER
static final int SIZE_BIG_INTEGERFits in aBigInteger. SeegetDecimalSize().- See Also:
-
SIZE_BIG_DECIMAL
static final int SIZE_BIG_DECIMALFits in aBigDecimal. SeegetDecimalSize().- See Also:
-
WS_UNSPECIFIED
static final int WS_UNSPECIFIEDWhitespace rule unspecified. SeegetWhiteSpaceRule().- See Also:
-
WS_PRESERVE
static final int WS_PRESERVEWhitespace preserved. SeegetWhiteSpaceRule().- See Also:
-
WS_REPLACE
static final int WS_REPLACEWhitespace replaced by ordinary space. SeegetWhiteSpaceRule().- See Also:
-
WS_COLLAPSE
static final int WS_COLLAPSEWhitespace collapsed and trimmed. SeegetWhiteSpaceRule().- See Also:
-
-
Method Details
-
getName
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:
getNamein 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
QName getDocumentElementName()Returns the document element name if this is a document type, or null otherwise. -
getAttributeTypeAttributeName
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
String getFullJavaName()The fully-qualified Java type name of the class. -
getShortJavaName
String getShortJavaName()The short unqualfiied Java name for the class. -
getFullJavaImplName
String getFullJavaImplName()The fully-qualified Java type name of the implementation class. -
getShortJavaImplName
String getShortJavaImplName()The short unqualfiied Java name for the implementation class. -
getJavaClass
The Java class corresponding to this schema type. -
getEnumJavaClass
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
Object getUserData()Returns user-specific information.- See Also:
-
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
Returns common base type with the given type. The returned type is the most specific declared base type of both types. -
isAssignableFrom
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:
getTypeSystemin 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_CONTENTfor 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 aSchemaTypeElementSequencerobject, 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
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
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
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
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
Returns the type of an attribute based on the attribute name and the type system within which (wildcard) names are resolved. -
getFacet
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
String[] getPatterns()True -
matchPatternFacet
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
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
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
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_UNSPECIFIEDfor unions and complex types. -
newValue
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
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>
-