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 com.sun.xml.xsom.impl.ComponentImpl
ownerDocument
Fields inherited from interface com.sun.xml.xsom.XSType
EXTENSION, RESTRICTION, SUBSTITUTION
-
Method Summary
Modifier and TypeMethodDescription<T> T
apply
(XSContentTypeFunction<T> f) <T> T
apply
(XSFunction<T> f) Accepts a functor.<T> T
apply
(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:null
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
.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.int
Gets the effective facet object of the given name.For multi-valued facets (enumeration and pattern), obtain all values.getName()
Gets the (local) name of the declaration.Gets a reference to theXSSchema
object to which this component belongs.Gets the ancestor primitive if this type isatomic
.If this 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.Gets the variety of this simple type.boolean
Deprecated.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
.boolean
Returns true ifthis instanceof XSSimpleType
.boolean
isUnion()
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.void
visit
(XSContentTypeVisitor visitor) void
visit
(XSSimpleTypeVisitor visitor) void
Accepts a visitor.Methods inherited from class com.sun.xml.xsom.impl.ComponentImpl
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, 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, getRoot, getSourceDocument, select, selectSingle
Methods inherited from interface com.sun.xml.xsom.XSDeclaration
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
-
Method Details
-
getOwnerSchema
Description copied from interface:XSComponent
Gets a reference to theXSSchema
object to which this component belongs.In case of
XSEmpty
component, this method returns null since there is no owner component.- Specified by:
getOwnerSchema
in interfaceXSComponent
- Overrides:
getOwnerSchema
in classComponentImpl
-
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 boolean isSimpleType()Description copied from interface:XSType
Returns true ifthis instanceof XSSimpleType
.- Specified by:
isSimpleType
in interfaceXSType
-
isComplexType
public boolean isComplexType()Description copied from interface:XSType
Returns true ifthis instanceof XSComplexType
.- Specified by:
isComplexType
in interfaceXSType
-
asEmpty
Description copied from interface:XSContentType
If this content type represents the empty content, returnthis
, otherwise null.- Specified by:
asEmpty
in interfaceXSContentType
-
asParticle
Description copied from interface:XSContentType
Equivalent of(this instanceof XSParticle)?this:null
- Specified by:
asParticle
in interfaceXSContentType
-
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.
-
getDerivationMethod
public int getDerivationMethod()- Specified by:
getDerivationMethod
in interfaceXSType
-
iterateDeclaredFacets
Description copied from interface:XSRestrictionSimpleType
Iterates facets that are specified in this step of derivation.- Specified by:
iterateDeclaredFacets
in interfaceXSRestrictionSimpleType
-
getDeclaredFacets
Description copied from interface:XSRestrictionSimpleType
Gets all the facets that are declared on this restriction.- Specified by:
getDeclaredFacets
in interfaceXSRestrictionSimpleType
- Returns:
- Can be empty but always non-null.
-
visit
- Specified by:
visit
in interfaceXSSimpleType
-
visit
- Specified by:
visit
in interfaceXSContentType
-
visit
Description copied from interface:XSComponent
Accepts a visitor.- Specified by:
visit
in interfaceXSComponent
-
apply
- Specified by:
apply
in interfaceXSSimpleType
-
apply
- Specified by:
apply
in interfaceXSContentType
-
apply
Description copied from interface:XSComponent
Accepts a functor.- Specified by:
apply
in interfaceXSComponent
-
getVariety
Description copied from interface:XSSimpleType
Gets the variety of this simple type.- Specified by:
getVariety
in interfaceXSSimpleType
-
getPrimitiveType
Description copied from interface:XSSimpleType
Gets the ancestor primitive if this type isatomic
.- Specified by:
getPrimitiveType
in interfaceXSSimpleType
- Returns:
- null otherwise.
-
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
-
getFacet
Description copied from interface:XSSimpleType
Gets 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:
getFacet
in 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:XSSimpleType
For multi-valued facets (enumeration and pattern), obtain all values.- Specified by:
getFacets
in interfaceXSSimpleType
- Returns:
- can be empty but never null.
- See Also:
-
getDeclaredFacet
Description copied from interface:XSRestrictionSimpleType
Gets 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:
getDeclaredFacet
in interfaceXSRestrictionSimpleType
- Returns:
- Null if the facet is not specified in the last step of derivation.
-
getDeclaredFacets
Description copied from interface:XSRestrictionSimpleType
Gets 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:
getDeclaredFacets
in interfaceXSRestrictionSimpleType
- Returns:
- can be empty but never be null.
-
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
-
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.
-
asRestriction
- Specified by:
asRestriction
in interfaceXSSimpleType
-
asList
- Specified by:
asList
in interfaceXSSimpleType
-
asUnion
- Specified by:
asUnion
in interfaceXSSimpleType
-
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
-
getRedefinedBy
Description copied from interface:XSSimpleType
If this 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
-
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
-
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
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
-