Package com.sun.xml.xsom.impl
Class SimpleTypeImpl
java.lang.Object
com.sun.xml.xsom.impl.ComponentImpl
com.sun.xml.xsom.impl.SimpleTypeImpl
- All Implemented Interfaces:
ContentTypeImpl
,Ref.ContentType
,Ref.SimpleType
,Ref.Type
,XSComponent
,XSContentType
,XSDeclaration
,XSSimpleType
,XSType
- Direct Known Subclasses:
ListSimpleTypeImpl
,RestrictionSimpleTypeImpl
,UnionSimpleTypeImpl
public abstract class SimpleTypeImpl
extends ComponentImpl
implements XSSimpleType, ContentTypeImpl, Ref.SimpleType
-
Field Summary
Fields inherited from class com.sun.xml.xsom.impl.ComponentImpl
ownerDocument
Fields inherited from interface com.sun.xml.xsom.XSType
EXTENSION, RESTRICTION, SUBSTITUTION
-
Method Summary
Modifier and TypeMethodDescriptionfinal Object
apply
(XSContentTypeFunction function) final Object
apply
(XSFunction function) Accepts a functor.final XSComplexType
Casts this object to XSComplexType if possible, otherwise returns null.final XSContentType
asEmpty()
If this content type represents the empty content, returnthis
, otherwise null.asList()
final XSParticle
Equivalent of(this instanceof XSParticle)?this:null
final XSSimpleType
Casts this object to XSSimpleType if possible, otherwise returns null.asUnion()
Gets the nearest ancestorXSListSimpleType
(including itself) if the variety of this type islist
.Returns the base type of this type.Gets the nearest ancestorXSUnionSimpleType
(including itself) if the variety of this type isunion
.final int
getName()
Gets the (local) name of the declaration.If thisXSSimpleType
is redefined by another simple type, return that component.int
Returns the number of complex types that redefine this component.Gets the base type as XSSimpleType.Target namespace to which this component belongs.getType()
Obtains a reference as a type.boolean
Deprecated.final boolean
Returns true ifthis instanceof XSComplexType
.boolean
Returns true if this type is derived from the specified type.boolean
Returns true if this type definition is marked as 'final' with respect to the givenXSVariety
.final boolean
isGlobal()
Returns true if this declaration is a global declaration.boolean
isList()
Returns true ifthis instanceof XSListSimpleType
.final boolean
isLocal()
Returns true if this declaration is a local declaration.boolean
Returns true if this is a primitive built-in simple type (that directly derives from xs:anySimpleType, by definition.)boolean
Returns true ifthis instanceof XSRestrictionSimpleType
.final boolean
Returns true ifthis instanceof XSSimpleType
.boolean
isUnion()
Returns true ifthis instanceof XSUnionSimpleType
.XSType[]
Lists up types that can substitute this type by using xsi:type.void
final void
visit
(XSContentTypeVisitor visitor) final void
Accepts a visitor.Methods inherited from class com.sun.xml.xsom.impl.ComponentImpl
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.sun.xml.xsom.XSComponent
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle
Methods inherited from interface com.sun.xml.xsom.XSDeclaration
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
Methods inherited from interface com.sun.xml.xsom.XSSimpleType
apply, getFacet, getFacets, getPrimitiveType, getVariety, visit
-
Method Details
-
listSubstitutables
Description copied from interface:XSType
Lists up types that can substitute this type by using xsi:type. Includes this type itself.This method honors the block flag.
- Specified by:
listSubstitutables
in interfaceXSType
-
redefine
-
getRedefinedBy
Description copied from interface:XSSimpleType
If thisXSSimpleType
is redefined by another simple type, return that component.- Specified by:
getRedefinedBy
in interfaceXSSimpleType
- Specified by:
getRedefinedBy
in interfaceXSType
- Returns:
- null if this component has not been redefined.
-
getRedefinedCount
public int getRedefinedCount()Description copied from interface:XSType
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.
- Specified by:
getRedefinedCount
in interfaceXSType
-
getBaseType
Description copied from interface:XSType
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.- Specified by:
getBaseType
in interfaceXSType
- Returns:
- always non-null.
-
getSimpleBaseType
Description copied from interface:XSSimpleType
Gets the base type as XSSimpleType. Equivalent to(XSSimpleType)getBaseType()
Since this is a simple type, we know that the base type is also a simple type. The only exception is xs:anySimpleType, which has xs:anyType as the base type.- Specified by:
getSimpleBaseType
in interfaceXSSimpleType
- Returns:
- null if this is xs:anySimpleType. Otherwise non-null.
-
isPrimitive
public boolean isPrimitive()Description copied from interface:XSSimpleType
Returns true if this is a primitive built-in simple type (that directly derives from xs:anySimpleType, by definition.)- Specified by:
isPrimitive
in interfaceXSSimpleType
-
getBaseListType
Description copied from interface:XSSimpleType
Gets the nearest ancestorXSListSimpleType
(including itself) if the variety of this type islist
.- Specified by:
getBaseListType
in interfaceXSSimpleType
- Returns:
- otherwise return null
-
getBaseUnionType
Description copied from interface:XSSimpleType
Gets the nearest ancestorXSUnionSimpleType
(including itself) if the variety of this type isunion
.- Specified by:
getBaseUnionType
in interfaceXSSimpleType
- Returns:
- otherwise return null
-
isFinal
Description copied from interface:XSSimpleType
Returns true if this type definition is marked as 'final' with respect to the givenXSVariety
.- Specified by:
isFinal
in interfaceXSSimpleType
- Returns:
- true if the type is marked final.
-
getDerivationMethod
public final int getDerivationMethod()- Specified by:
getDerivationMethod
in interfaceXSType
-
asSimpleType
Description copied from interface:XSType
Casts this object to XSSimpleType if possible, otherwise returns null.- Specified by:
asSimpleType
in interfaceXSContentType
- Specified by:
asSimpleType
in interfaceXSType
-
asComplexType
Description copied from interface:XSType
Casts this object to XSComplexType if possible, otherwise returns null.- Specified by:
asComplexType
in interfaceXSType
-
isDerivedFrom
Description copied from interface:XSType
Returns true if this type is derived from the specified type.Note that
t.isDerivedFrom(t)
returns true.- Specified by:
isDerivedFrom
in interfaceXSType
-
isSimpleType
public final boolean isSimpleType()Description copied from interface:XSType
Returns true ifthis instanceof XSSimpleType
.- Specified by:
isSimpleType
in interfaceXSType
-
isComplexType
public final boolean isComplexType()Description copied from interface:XSType
Returns true ifthis instanceof XSComplexType
.- Specified by:
isComplexType
in interfaceXSType
-
asParticle
Description copied from interface:XSContentType
Equivalent of(this instanceof XSParticle)?this:null
- Specified by:
asParticle
in interfaceXSContentType
-
asEmpty
Description copied from interface:XSContentType
If this content type represents the empty content, returnthis
, otherwise null.- Specified by:
asEmpty
in interfaceXSContentType
-
isRestriction
public boolean isRestriction()Description copied from interface:XSSimpleType
Returns true ifthis instanceof XSRestrictionSimpleType
.- Specified by:
isRestriction
in interfaceXSSimpleType
-
isList
public boolean isList()Description copied from interface:XSSimpleType
Returns true ifthis instanceof XSListSimpleType
.- Specified by:
isList
in interfaceXSSimpleType
-
isUnion
public boolean isUnion()Description copied from interface:XSSimpleType
Returns true ifthis instanceof XSUnionSimpleType
.- Specified by:
isUnion
in interfaceXSSimpleType
-
asRestriction
- Specified by:
asRestriction
in interfaceXSSimpleType
-
asList
- Specified by:
asList
in interfaceXSSimpleType
-
asUnion
- Specified by:
asUnion
in interfaceXSSimpleType
-
visit
Description copied from interface:XSComponent
Accepts a visitor.- Specified by:
visit
in interfaceXSComponent
-
visit
- Specified by:
visit
in interfaceXSContentType
-
apply
Description copied from interface:XSComponent
Accepts a functor.- Specified by:
apply
in interfaceXSComponent
-
apply
- Specified by:
apply
in interfaceXSContentType
-
getContentType
- Specified by:
getContentType
in interfaceRef.ContentType
-
getType
Description copied from interface:Ref.Type
Obtains a reference as a type.- Specified by:
getType
in interfaceRef.SimpleType
- Specified by:
getType
in interfaceRef.Type
-
getName
Description copied from interface:XSDeclaration
Gets the (local) name of the declaration.- Specified by:
getName
in interfaceXSDeclaration
- Returns:
- null if this component is anonymous.
-
getTargetNamespace
Description copied from interface:XSDeclaration
Target namespace to which this component belongs.""
is used to represent the default no namespace.- Specified by:
getTargetNamespace
in interfaceXSDeclaration
-
isAnonymous
public boolean isAnonymous()Deprecated.- Specified by:
isAnonymous
in interfaceXSDeclaration
-
isGlobal
public final boolean isGlobal()Description copied from interface:XSDeclaration
Returns true if this declaration is a global declaration. Global declarations are those declaration that can be enumerated through the schema object.- Specified by:
isGlobal
in interfaceXSDeclaration
-
isLocal
public final boolean isLocal()Description copied from interface:XSDeclaration
Returns true if this declaration is a local declaration. Equivalent of!isGlobal()
- Specified by:
isLocal
in interfaceXSDeclaration
-