Class SchemaSetImpl.AnySimpleType
- All Implemented Interfaces:
Ref.SimpleType, Ref.Type, XSComponent, XSContentType, XSDeclaration, XSRestrictionSimpleType, XSSimpleType, XSType
- Enclosing class:
SchemaSetImpl
-
Field Summary
Fields inherited from class ComponentImpl
ownerDocumentFields inherited from interface XSType
EXTENSION, RESTRICTION, SUBSTITUTION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Tapply(XSContentTypeFunction<T> f) <T> Tapply(XSFunction<T> f) Accepts a functor.<T> Tapply(XSSimpleTypeFunction<T> f) Casts this object to XSComplexType if possible, otherwise returns null.asEmpty()If this content type represents the empty content, returnthis, otherwise null.asList()Equivalent of(this instanceof XSParticle)?this:nullCasts 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.getDeclaredFacet(String name) Gets the declared facet object of the given name.Collection<? extends XSFacet> Gets all the facets that are declared on this restriction.getDeclaredFacets(String name) Gets the declared facets of the given name.intGets the effective facet object of the given name.For multi-valued facets (enumeration and pattern), obtain all values.Gets a reference to theXSSchemaobject to which this component belongs.Gets the ancestor primitiveXSSimpleTypeif this type isatomic.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.getType()Obtains a reference as a type.Gets the variety of this simple type.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.booleanisList()Returns true ifthis instanceof XSListSimpleType.booleanReturns true if this is a primitive built-in simple type (that directly derives from xs:anySimpleType, by definition.)booleanReturns true ifthis instanceof XSRestrictionSimpleType.booleanReturns true ifthis instanceof XSSimpleType.booleanisUnion()Returns true ifthis instanceof XSUnionSimpleType.Iterates facets that are specified in this step of derivation.XSType[]Lists up types that can substitute this type by using xsi:type.voidvisit(XSContentTypeVisitor visitor) voidvisit(XSSimpleTypeVisitor visitor) voidAccepts a visitor.Methods inherited from class DeclarationImpl
getName, getTargetNamespace, isAnonymous, isGlobal, isLocalMethods inherited from class ComponentImpl
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getRoot, getSourceDocument, select, selectSingle, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface XSComponent
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getRoot, getSourceDocument, select, selectSingleMethods inherited from interface XSDeclaration
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
-
Constructor Details
-
AnySimpleType
AnySimpleType()
-
-
Method Details
-
getOwnerSchema
Description copied from interface:XSComponentGets a reference to theXSSchemaobject to which this component belongs.In case of
XSEmptycomponent, this method returns null since there is no owner component.- Specified by:
getOwnerSchemain interfaceXSComponent- Overrides:
getOwnerSchemain classComponentImpl
-
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 boolean isSimpleType()Description copied from interface:XSTypeReturns true ifthis instanceof XSSimpleType.- Specified by:
isSimpleTypein interfaceXSType
-
isComplexType
public boolean isComplexType()Description copied from interface:XSTypeReturns true ifthis instanceof XSComplexType.- Specified by:
isComplexTypein interfaceXSType
-
asEmpty
Description copied from interface:XSContentTypeIf this content type represents the empty content, returnthis, otherwise null.- Specified by:
asEmptyin interfaceXSContentType
-
asParticle
Description copied from interface:XSContentTypeEquivalent of(this instanceof XSParticle)?this:null- Specified by:
asParticlein interfaceXSContentType
-
getBaseType
Description copied from interface:XSTypeReturns the base type of this type. Note that if this type represents xs: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.
-
getDerivationMethod
public int getDerivationMethod()- Specified by:
getDerivationMethodin interfaceXSType
-
iterateDeclaredFacets
Description copied from interface:XSRestrictionSimpleTypeIterates facets that are specified in this step of derivation.- Specified by:
iterateDeclaredFacetsin interfaceXSRestrictionSimpleType
-
getDeclaredFacets
Description copied from interface:XSRestrictionSimpleTypeGets all the facets that are declared on this restriction.- Specified by:
getDeclaredFacetsin interfaceXSRestrictionSimpleType- Returns:
- Can be empty but always non-null.
-
visit
- Specified by:
visitin interfaceXSSimpleType
-
visit
- Specified by:
visitin interfaceXSContentType
-
visit
Description copied from interface:XSComponentAccepts a visitor.- Specified by:
visitin interfaceXSComponent
-
apply
- Specified by:
applyin interfaceXSSimpleType
-
apply
- Specified by:
applyin interfaceXSContentType
-
apply
Description copied from interface:XSComponentAccepts a functor.- Specified by:
applyin interfaceXSComponent
-
getVariety
Description copied from interface:XSSimpleTypeGets the variety of this simple type.- Specified by:
getVarietyin interfaceXSSimpleType
-
getPrimitiveType
Description copied from interface:XSSimpleTypeGets the ancestor primitiveXSSimpleTypeif this type isatomic.- Specified by:
getPrimitiveTypein interfaceXSSimpleType- Returns:
- null otherwise.
-
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
-
getFacet
Description copied from interface:XSSimpleTypeGets the effective facet object of the given name.For example, if a simple type "foo" is derived from xs:string by restriction with the "maxLength" facet and another simple type "bar" is derived from "foo" by restriction with another "maxLength" facet, this method will return the latter one, because that is the most restrictive, effective facet.
For those facets that can have multiple values (pattern facets and enumeration facets), this method will return only the first one. TODO: allow clients to access all of them by some means.
- Specified by:
getFacetin interfaceXSSimpleType- Returns:
- If this datatype has a facet of the given name, return that object. If the facet is not specified anywhere in its derivation chain, null will be returned.
-
getFacets
Description copied from interface:XSSimpleTypeFor multi-valued facets (enumeration and pattern), obtain all values.- Specified by:
getFacetsin interfaceXSSimpleType- Returns:
- can be empty but never null.
- See Also:
-
getDeclaredFacet
Description copied from interface:XSRestrictionSimpleTypeGets the declared facet object of the given name.This method returns a facet object that is added in this type and does not recursively check the ancestors.
For those facets that can have multiple values (pattern facets and enumeration facets), this method will return only the first one.
- Specified by:
getDeclaredFacetin interfaceXSRestrictionSimpleType- Returns:
- Null if the facet is not specified in the last step of derivation.
-
getDeclaredFacets
Description copied from interface:XSRestrictionSimpleTypeGets the declared facets of the given name. This method is for those facets (such as 'pattern') that can be specified multiple times on a simple type.- Specified by:
getDeclaredFacetsin interfaceXSRestrictionSimpleType- Returns:
- can be empty but never be null.
-
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
-
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.
-
asRestriction
- Specified by:
asRestrictionin interfaceXSSimpleType
-
asList
- Specified by:
asListin interfaceXSSimpleType
-
asUnion
- Specified by:
asUnionin interfaceXSSimpleType
-
getType
Description copied from interface:Ref.TypeObtains a reference as a type.- Specified by:
getTypein interfaceRef.SimpleType- Specified by:
getTypein interfaceRef.Type
-
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
-
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
-