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
ownerDocumentFields inherited from interface com.sun.xml.xsom.XSType
EXTENSION, RESTRICTION, SUBSTITUTION -
Method Summary
Modifier and TypeMethodDescriptionfinal Objectapply(XSContentTypeFunction function) final Objectapply(XSFunction function) Accepts a functor.final XSComplexTypeCasts this object to XSComplexType if possible, otherwise returns null.final XSContentTypeasEmpty()If this content type represents the empty content, returnthis, otherwise null.asList()final XSParticleEquivalent of(this instanceof XSParticle)?this:nullfinal XSSimpleTypeCasts 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 intgetName()Gets the (local) name of the declaration.If thisXSSimpleTypeis redefined by another simple type, return that component.intReturns 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.booleanDeprecated.final booleanReturns true ifthis instanceof XSComplexType.booleanReturns true if this type is derived from the specified type.booleanReturns true if this type definition is marked as 'final' with respect to the givenXSVariety.final booleanisGlobal()Returns true if this declaration is a global declaration.booleanisList()Returns true ifthis instanceof XSListSimpleType.final booleanisLocal()Returns true if this declaration is a local declaration.booleanReturns true if this is a primitive built-in simple type (that directly derives from xs:anySimpleType, by definition.)booleanReturns true ifthis instanceof XSRestrictionSimpleType.final booleanReturns true ifthis instanceof XSSimpleType.booleanisUnion()Returns true ifthis instanceof XSUnionSimpleType.XSType[]Lists up types that can substitute this type by using xsi:type.voidfinal voidvisit(XSContentTypeVisitor visitor) final voidAccepts a visitor.Methods inherited from class com.sun.xml.xsom.impl.ComponentImpl
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.sun.xml.xsom.XSComponent
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingleMethods inherited from interface com.sun.xml.xsom.XSDeclaration
getName, getTargetNamespace, isAnonymous, isGlobal, isLocalMethods inherited from interface com.sun.xml.xsom.XSSimpleType
apply, getFacet, getFacets, getPrimitiveType, getVariety, visit
-
Method Details
-
listSubstitutables
Description copied from interface:XSTypeLists up types that can substitute this type by using xsi:type. Includes this type itself.This method honors the block flag.
- Specified by:
listSubstitutablesin interfaceXSType
-
redefine
-
getRedefinedBy
Description copied from interface:XSSimpleTypeIf thisXSSimpleTypeis redefined by another simple type, return that component.- Specified by:
getRedefinedByin interfaceXSSimpleType- Specified by:
getRedefinedByin interfaceXSType- Returns:
- null if this component has not been redefined.
-
getRedefinedCount
public int getRedefinedCount()Description copied from interface:XSTypeReturns 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:
getRedefinedCountin interfaceXSType
-
getBaseType
Description copied from interface:XSTypeReturns 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:
getBaseTypein interfaceXSType- Returns:
- always non-null.
-
getSimpleBaseType
Description copied from interface:XSSimpleTypeGets 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:
getSimpleBaseTypein interfaceXSSimpleType- Returns:
- null if this is xs:anySimpleType. Otherwise non-null.
-
isPrimitive
public boolean isPrimitive()Description copied from interface:XSSimpleTypeReturns true if this is a primitive built-in simple type (that directly derives from xs:anySimpleType, by definition.)- Specified by:
isPrimitivein interfaceXSSimpleType
-
getBaseListType
Description copied from interface:XSSimpleTypeGets the nearest ancestorXSListSimpleType(including itself) if the variety of this type islist.- Specified by:
getBaseListTypein interfaceXSSimpleType- Returns:
- otherwise return null
-
getBaseUnionType
Description copied from interface:XSSimpleTypeGets the nearest ancestorXSUnionSimpleType(including itself) if the variety of this type isunion.- Specified by:
getBaseUnionTypein interfaceXSSimpleType- Returns:
- otherwise return null
-
isFinal
Description copied from interface:XSSimpleTypeReturns true if this type definition is marked as 'final' with respect to the givenXSVariety.- Specified by:
isFinalin interfaceXSSimpleType- Returns:
- true if the type is marked final.
-
getDerivationMethod
public final int getDerivationMethod()- Specified by:
getDerivationMethodin interfaceXSType
-
asSimpleType
Description copied from interface:XSTypeCasts this object to XSSimpleType if possible, otherwise returns null.- Specified by:
asSimpleTypein interfaceXSContentType- Specified by:
asSimpleTypein interfaceXSType
-
asComplexType
Description copied from interface:XSTypeCasts this object to XSComplexType if possible, otherwise returns null.- Specified by:
asComplexTypein interfaceXSType
-
isDerivedFrom
Description copied from interface:XSTypeReturns true if this type is derived from the specified type.Note that
t.isDerivedFrom(t)returns true.- Specified by:
isDerivedFromin interfaceXSType
-
isSimpleType
public final boolean isSimpleType()Description copied from interface:XSTypeReturns true ifthis instanceof XSSimpleType.- Specified by:
isSimpleTypein interfaceXSType
-
isComplexType
public final boolean isComplexType()Description copied from interface:XSTypeReturns true ifthis instanceof XSComplexType.- Specified by:
isComplexTypein interfaceXSType
-
asParticle
Description copied from interface:XSContentTypeEquivalent of(this instanceof XSParticle)?this:null- Specified by:
asParticlein interfaceXSContentType
-
asEmpty
Description copied from interface:XSContentTypeIf this content type represents the empty content, returnthis, otherwise null.- Specified by:
asEmptyin interfaceXSContentType
-
isRestriction
public boolean isRestriction()Description copied from interface:XSSimpleTypeReturns true ifthis instanceof XSRestrictionSimpleType.- Specified by:
isRestrictionin interfaceXSSimpleType
-
isList
public boolean isList()Description copied from interface:XSSimpleTypeReturns true ifthis instanceof XSListSimpleType.- Specified by:
isListin interfaceXSSimpleType
-
isUnion
public boolean isUnion()Description copied from interface:XSSimpleTypeReturns true ifthis instanceof XSUnionSimpleType.- Specified by:
isUnionin interfaceXSSimpleType
-
asRestriction
- Specified by:
asRestrictionin interfaceXSSimpleType
-
asList
- Specified by:
asListin interfaceXSSimpleType
-
asUnion
- Specified by:
asUnionin interfaceXSSimpleType
-
visit
Description copied from interface:XSComponentAccepts a visitor.- Specified by:
visitin interfaceXSComponent
-
visit
- Specified by:
visitin interfaceXSContentType
-
apply
Description copied from interface:XSComponentAccepts a functor.- Specified by:
applyin interfaceXSComponent
-
apply
- Specified by:
applyin interfaceXSContentType
-
getContentType
- Specified by:
getContentTypein interfaceRef.ContentType
-
getType
Description copied from interface:Ref.TypeObtains a reference as a type.- Specified by:
getTypein interfaceRef.SimpleType- Specified by:
getTypein interfaceRef.Type
-
getName
Description copied from interface:XSDeclarationGets the (local) name of the declaration.- Specified by:
getNamein interfaceXSDeclaration- Returns:
- null if this component is anonymous.
-
getTargetNamespace
Description copied from interface:XSDeclarationTarget namespace to which this component belongs.""is used to represent the default no namespace.- Specified by:
getTargetNamespacein interfaceXSDeclaration
-
isAnonymous
public boolean isAnonymous()Deprecated.- Specified by:
isAnonymousin interfaceXSDeclaration
-
isGlobal
public final boolean isGlobal()Description copied from interface:XSDeclarationReturns true if this declaration is a global declaration. Global declarations are those declaration that can be enumerated through the schema object.- Specified by:
isGlobalin interfaceXSDeclaration
-
isLocal
public final boolean isLocal()Description copied from interface:XSDeclarationReturns true if this declaration is a local declaration. Equivalent of!isGlobal()- Specified by:
isLocalin interfaceXSDeclaration
-