private class SchemaSetImpl.AnySimpleType extends DeclarationImpl implements XSRestrictionSimpleType, Ref.SimpleType
ownerDocument
EXTENSION, RESTRICTION, SUBSTITUTION
Constructor and Description |
---|
AnySimpleType() |
Modifier and Type | Method and Description |
---|---|
<T> T |
apply(XSContentTypeFunction<T> f) |
<T> T |
apply(XSFunction<T> f)
Accepts a functor.
|
<T> T |
apply(XSSimpleTypeFunction<T> f) |
XSComplexType |
asComplexType()
Casts this object to XSComplexType if possible, otherwise returns null.
|
XSContentType |
asEmpty()
If this content type represents the empty content, return
this ,
otherwise null. |
XSListSimpleType |
asList() |
XSParticle |
asParticle()
Equivalent of
(this instanceof XSParticle)?this:null |
XSRestrictionSimpleType |
asRestriction() |
XSSimpleType |
asSimpleType()
Casts this object to XSSimpleType if possible, otherwise returns null.
|
XSUnionSimpleType |
asUnion() |
XSListSimpleType |
getBaseListType()
Gets the nearest ancestor
XSListSimpleType (including itself)
if the variety of this type is list . |
XSType |
getBaseType()
Returns the base type of this type.
|
XSUnionSimpleType |
getBaseUnionType()
Gets the nearest ancestor
XSUnionSimpleType (including itself)
if the variety of this type is union . |
XSFacet |
getDeclaredFacet(java.lang.String name)
Gets the declared facet object of the given name.
|
java.util.Collection<? extends XSFacet> |
getDeclaredFacets()
Gets all the facets that are declared on this restriction.
|
java.util.List<XSFacet> |
getDeclaredFacets(java.lang.String name)
Gets the declared facets of the given name.
|
int |
getDerivationMethod() |
XSFacet |
getFacet(java.lang.String name)
Gets the effective facet object of the given name.
|
java.util.List<XSFacet> |
getFacets(java.lang.String name)
For multi-valued facets (enumeration and pattern), obtain all values.
|
SchemaImpl |
getOwnerSchema()
Gets a reference to the
XSSchema object to which this component
belongs. |
XSSimpleType |
getPrimitiveType()
Gets the ancestor primitive
XSSimpleType if
this type is atomic . |
XSSimpleType |
getRedefinedBy()
If this
XSSimpleType is redefined by another simple type,
return that component. |
int |
getRedefinedCount()
Returns the number of complex types that redefine this component.
|
XSSimpleType |
getSimpleBaseType()
Gets the base type as XSSimpleType.
|
XSSimpleType |
getType()
Obtains a reference as a type.
|
XSVariety |
getVariety()
Gets the variety of this simple type.
|
boolean |
isComplexType()
Returns true if
this instanceof XSComplexType . |
boolean |
isDerivedFrom(XSType t)
Returns true if this type is derived from the specified type.
|
boolean |
isFinal(XSVariety v)
Returns true if this type definition is marked as 'final'
with respect to the given
XSVariety . |
boolean |
isList()
Returns true if
this instanceof XSListSimpleType . |
boolean |
isPrimitive()
Returns true if this is a primitive built-in simple type
(that directly derives from xs:anySimpleType, by definition.)
|
boolean |
isRestriction()
Returns true if
this instanceof XSRestrictionSimpleType . |
boolean |
isSimpleType()
Returns true if
this instanceof XSSimpleType . |
boolean |
isUnion()
Returns true if
this instanceof XSUnionSimpleType . |
java.util.Iterator<XSFacet> |
iterateDeclaredFacets()
Iterates facets that are specified in this step of derivation.
|
XSType[] |
listSubstitutables()
Lists up types that can substitute this type by using xsi:type.
|
void |
visit(XSContentTypeVisitor visitor) |
void |
visit(XSSimpleTypeVisitor visitor) |
void |
visit(XSVisitor visitor)
Accepts a visitor.
|
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getRoot, getSourceDocument, select, selectSingle, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getRoot, getSourceDocument, select, selectSingle
public SchemaImpl getOwnerSchema()
XSComponent
XSSchema
object to which this component
belongs.
In case of XSEmpty
component, this method
returns null since there is no owner component.
getOwnerSchema
in interface XSComponent
getOwnerSchema
in class ComponentImpl
public XSSimpleType asSimpleType()
XSType
asSimpleType
in interface XSContentType
asSimpleType
in interface XSType
public XSComplexType asComplexType()
XSType
asComplexType
in interface XSType
public boolean isDerivedFrom(XSType t)
XSType
Note that t.isDerivedFrom(t) returns true.
isDerivedFrom
in interface XSType
public boolean isSimpleType()
XSType
this instanceof XSSimpleType
.isSimpleType
in interface XSType
public boolean isComplexType()
XSType
this instanceof XSComplexType
.isComplexType
in interface XSType
public XSContentType asEmpty()
XSContentType
this
,
otherwise null.asEmpty
in interface XSContentType
public XSParticle asParticle()
XSContentType
(this instanceof XSParticle)?this:null
asParticle
in interface XSContentType
public XSType getBaseType()
XSType
getBaseType
in interface XSType
public XSSimpleType getSimpleBaseType()
XSSimpleType
(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.getSimpleBaseType
in interface XSSimpleType
public int getDerivationMethod()
getDerivationMethod
in interface XSType
public java.util.Iterator<XSFacet> iterateDeclaredFacets()
XSRestrictionSimpleType
iterateDeclaredFacets
in interface XSRestrictionSimpleType
public java.util.Collection<? extends XSFacet> getDeclaredFacets()
XSRestrictionSimpleType
getDeclaredFacets
in interface XSRestrictionSimpleType
public void visit(XSSimpleTypeVisitor visitor)
visit
in interface XSSimpleType
public void visit(XSContentTypeVisitor visitor)
visit
in interface XSContentType
public void visit(XSVisitor visitor)
XSComponent
visit
in interface XSComponent
public <T> T apply(XSSimpleTypeFunction<T> f)
apply
in interface XSSimpleType
public <T> T apply(XSContentTypeFunction<T> f)
apply
in interface XSContentType
public <T> T apply(XSFunction<T> f)
XSComponent
apply
in interface XSComponent
public XSVariety getVariety()
XSSimpleType
getVariety
in interface XSSimpleType
public XSSimpleType getPrimitiveType()
XSSimpleType
XSSimpleType
if
this type is atomic
.getPrimitiveType
in interface XSSimpleType
public boolean isPrimitive()
XSSimpleType
isPrimitive
in interface XSSimpleType
public XSListSimpleType getBaseListType()
XSSimpleType
XSListSimpleType
(including itself)
if the variety of this type is list
.getBaseListType
in interface XSSimpleType
public XSUnionSimpleType getBaseUnionType()
XSSimpleType
XSUnionSimpleType
(including itself)
if the variety of this type is union
.getBaseUnionType
in interface XSSimpleType
public XSFacet getFacet(java.lang.String name)
XSSimpleType
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.
getFacet
in interface XSSimpleType
public java.util.List<XSFacet> getFacets(java.lang.String name)
XSSimpleType
getFacets
in interface XSSimpleType
XSSimpleType.getFacet(String)
public XSFacet getDeclaredFacet(java.lang.String name)
XSRestrictionSimpleType
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.
getDeclaredFacet
in interface XSRestrictionSimpleType
public java.util.List<XSFacet> getDeclaredFacets(java.lang.String name)
XSRestrictionSimpleType
getDeclaredFacets
in interface XSRestrictionSimpleType
public boolean isRestriction()
XSSimpleType
this instanceof XSRestrictionSimpleType
.isRestriction
in interface XSSimpleType
public boolean isList()
XSSimpleType
this instanceof XSListSimpleType
.isList
in interface XSSimpleType
public boolean isUnion()
XSSimpleType
this instanceof XSUnionSimpleType
.isUnion
in interface XSSimpleType
public boolean isFinal(XSVariety v)
XSSimpleType
XSVariety
.isFinal
in interface XSSimpleType
public XSRestrictionSimpleType asRestriction()
asRestriction
in interface XSSimpleType
public XSListSimpleType asList()
asList
in interface XSSimpleType
public XSUnionSimpleType asUnion()
asUnion
in interface XSSimpleType
public XSSimpleType getType()
Ref.Type
getType
in interface Ref.SimpleType
getType
in interface Ref.Type
public XSSimpleType getRedefinedBy()
XSSimpleType
XSSimpleType
is redefined by another simple type,
return that component.getRedefinedBy
in interface XSSimpleType
getRedefinedBy
in interface XSType
public int getRedefinedCount()
XSType
For example, if A is redefined by B and B is redefined by C, A.getRedefinedCount()==2, B.getRedefinedCount()==1, and C.getRedefinedCount()==0.
getRedefinedCount
in interface XSType
public XSType[] listSubstitutables()
XSType
This method honors the block flag.
listSubstitutables
in interface XSType