Package com.sun.xml.xsom
Interface XSType
- All Superinterfaces:
XSComponent
,XSDeclaration
- All Known Subinterfaces:
XSComplexType
,XSListSimpleType
,XSRestrictionSimpleType
,XSSimpleType
,XSUnionSimpleType
- All Known Implementing Classes:
ComplexTypeImpl
,ListSimpleTypeImpl
,RestrictionSimpleTypeImpl
,SimpleTypeImpl
,UnionSimpleTypeImpl
Base interface for
XSComplexType
and XSSimpleType
.- Author:
- Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionCasts this object to XSComplexType if possible, otherwise returns null.Casts this object to XSSimpleType if possible, otherwise returns null.Returns the base type of this type.int
If thisXSType
is redefined by another type, return that component.int
Returns the number of complex types that redefine this component.boolean
Returns true ifthis instanceof XSComplexType
.boolean
Returns true if this type is derived from the specified type.boolean
Returns true ifthis instanceof XSSimpleType
.XSType[]
Lists up types that can substitute this type by using xsi:type.Methods inherited from interface com.sun.xml.xsom.XSComponent
apply, getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle, visit
Methods inherited from interface com.sun.xml.xsom.XSDeclaration
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
-
Field Details
-
EXTENSION
static final int EXTENSION- See Also:
-
RESTRICTION
static final int RESTRICTION- See Also:
-
SUBSTITUTION
static final int SUBSTITUTION- See Also:
-
-
Method Details
-
getBaseType
XSType getBaseType()Returns the base type of this type. Note that if this type representsxs:anyType
, this method returns itself. This is awkward as an API, but it follows the schema specification.- Returns:
- always non-null.
-
getDerivationMethod
int getDerivationMethod() -
isSimpleType
boolean isSimpleType()Returns true ifthis instanceof XSSimpleType
. -
isComplexType
boolean isComplexType()Returns true ifthis instanceof XSComplexType
. -
listSubstitutables
XSType[] listSubstitutables()Lists up types that can substitute this type by using xsi:type. Includes this type itself.This method honors the block flag.
-
getRedefinedBy
XSType getRedefinedBy()If thisXSType
is redefined by another type, return that component.- Returns:
- null if this component has not been redefined.
-
getRedefinedCount
int getRedefinedCount()Returns the number of complex types that redefine this component.For example, if A is redefined by B and B is redefined by C, A.getRedefinedCount()==2, B.getRedefinedCount()==1, and C.getRedefinedCount()==0.
-
asSimpleType
XSSimpleType asSimpleType()Casts this object to XSSimpleType if possible, otherwise returns null. -
asComplexType
XSComplexType asComplexType()Casts this object to XSComplexType if possible, otherwise returns null. -
isDerivedFrom
Returns true if this type is derived from the specified type.Note that
t.isDerivedFrom(t)
returns true.
-