public abstract class SimpleTypeImpl extends ComponentImpl implements XSSimpleType, ContentTypeImpl, Ref.SimpleType
ownerDocument
EXTENSION, RESTRICTION, SUBSTITUTION
Modifier and Type | Method and Description |
---|---|
Object |
apply(XSContentTypeFunction function) |
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() |
String |
getName()
Gets the (local) name of the declaration.
|
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.
|
String |
getTargetNamespace()
Target namespace to which this component belongs.
|
XSSimpleType |
getType()
Obtains a reference as a type.
|
boolean |
isAnonymous()
Deprecated.
|
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 |
isGlobal()
Returns true if this declaration is a global declaration.
|
boolean |
isList()
Returns true if
this instanceof XSListSimpleType . |
boolean |
isLocal()
Returns true if this declaration is a local declaration.
|
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.
|
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
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
xs:anyType
, this method returns itself.
This is awkward as an API, but it follows the schema specification.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 Object apply(XSFunction function)
XSComponent
apply
in interface XSComponent
public final 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
public String getName()
XSDeclaration
getName
in interface XSDeclaration
public String getTargetNamespace()
XSDeclaration
""
is used to represent the default no namespace.getTargetNamespace
in interface XSDeclaration
public boolean isAnonymous()
isAnonymous
in interface XSDeclaration
public final boolean isGlobal()
XSDeclaration
isGlobal
in interface XSDeclaration
public final boolean isLocal()
XSDeclaration
!isGlobal()
isLocal
in interface XSDeclaration
Copyright © 2021 JBoss by Red Hat. All rights reserved.