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.

First, there is the universal base type and the universal
subtype. These are XmlObject.type
(corresponding to xs:anyType) and XmlBeans.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 return true for isURType(), and
only XmlBeans.NO_TYPE returns true for isNoType().

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() and isAttributeType(). 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 consdered 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 either ATOMIC, LIST, or
UNION.

A LIST simple type is always based on another non-list
simple type. The underlying list item type can be obtained
by using getListItemType().

A UNION simple type is always composed out of a number of
other simple types. The direct members of the union can
be obtained by getUnionMemberTypes(). 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
by getUnionConstituentTypes(). The closure of the
entire "union tree" is getUnionSubTypes() (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 return
EMPTY_CONTENT, SIMPLE_CONTENT,
ELEMENT_CONTENT, or MIXED_CONTENT.

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 or MIXED_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 via getContentModel().

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.

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.

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).

getContainerField

isDocumentType

public 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

public 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.)

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.

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.

getElementSequencer

Returns a SchemaTypeElementSequencer 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.

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

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

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.

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

public 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.