public abstract class SimpleTypeImpl extends DeclarationImpl implements XSSimpleType, ContentTypeImpl, Ref.SimpleType
Modifier and Type | Field and Description |
---|---|
private Ref.SimpleType |
baseType |
private java.util.Set<XSVariety> |
finalSet |
private SimpleTypeImpl |
redefinedBy |
private short |
redefiningCount
Number of times this component redefines other components.
|
ownerDocument
EXTENSION, RESTRICTION, SUBSTITUTION
Constructor and Description |
---|
SimpleTypeImpl(SchemaDocumentImpl _parent,
AnnotationImpl _annon,
org.xml.sax.Locator _loc,
ForeignAttributesImpl _fa,
java.lang.String _name,
boolean _anonymous,
java.util.Set<XSVariety> finalSet,
Ref.SimpleType _baseType) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
apply(XSContentTypeFunction function) |
java.lang.Object |
apply(XSFunction function)
Accepts a functor.
|
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 . |
XSContentType |
getContentType() |
int |
getDerivationMethod() |
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.
|
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 . |
XSType[] |
listSubstitutables()
Lists up types that can substitute this type by using xsi:type.
|
void |
redefine(SimpleTypeImpl st) |
void |
visit(XSContentTypeVisitor visitor) |
void |
visit(XSVisitor visitor)
Accepts a visitor.
|
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
apply, getFacet, getFacets, getPrimitiveType, getVariety, visit
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle
private Ref.SimpleType baseType
private short redefiningCount
private SimpleTypeImpl redefinedBy
private final java.util.Set<XSVariety> finalSet
SimpleTypeImpl(SchemaDocumentImpl _parent, AnnotationImpl _annon, org.xml.sax.Locator _loc, ForeignAttributesImpl _fa, java.lang.String _name, boolean _anonymous, java.util.Set<XSVariety> finalSet, Ref.SimpleType _baseType)
public XSType[] listSubstitutables()
XSType
This method honors the block flag.
listSubstitutables
in interface XSType
public void redefine(SimpleTypeImpl st)
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 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 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 boolean isFinal(XSVariety v)
XSSimpleType
XSVariety
.isFinal
in interface XSSimpleType
public final int getDerivationMethod()
getDerivationMethod
in interface XSType
public final XSSimpleType asSimpleType()
XSType
asSimpleType
in interface XSContentType
asSimpleType
in interface XSType
public final 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 final boolean isSimpleType()
XSType
this instanceof XSSimpleType
.isSimpleType
in interface XSType
public final boolean isComplexType()
XSType
this instanceof XSComplexType
.isComplexType
in interface XSType
public final XSParticle asParticle()
XSContentType
(this instanceof XSParticle)?this:null
asParticle
in interface XSContentType
public final XSContentType asEmpty()
XSContentType
this
,
otherwise null.asEmpty
in interface XSContentType
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 XSRestrictionSimpleType asRestriction()
asRestriction
in interface XSSimpleType
public XSListSimpleType asList()
asList
in interface XSSimpleType
public XSUnionSimpleType asUnion()
asUnion
in interface XSSimpleType
public final void visit(XSVisitor visitor)
XSComponent
visit
in interface XSComponent
public final void visit(XSContentTypeVisitor visitor)
visit
in interface XSContentType
public final java.lang.Object apply(XSFunction function)
XSComponent
apply
in interface XSComponent
public final java.lang.Object apply(XSContentTypeFunction function)
apply
in interface XSContentType
public XSContentType getContentType()
getContentType
in interface Ref.ContentType
public XSSimpleType getType()
Ref.Type
getType
in interface Ref.SimpleType
getType
in interface Ref.Type