public class RestrictionSimpleTypeImpl extends SimpleTypeImpl implements XSRestrictionSimpleType
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<XSFacet> |
facets |
ownerDocumentEXTENSION, RESTRICTION, SUBSTITUTION| Constructor and Description |
|---|
RestrictionSimpleTypeImpl(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 |
|---|---|
void |
addFacet(XSFacet facet) |
java.lang.Object |
apply(XSSimpleTypeFunction function) |
XSRestrictionSimpleType |
asRestriction() |
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.
|
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.
|
XSSimpleType |
getPrimitiveType()
Gets the ancestor primitive
XSSimpleType if
this type is atomic. |
XSVariety |
getVariety()
Gets the variety of this simple type.
|
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. |
java.util.Iterator<XSFacet> |
iterateDeclaredFacets()
Iterates facets that are specified in this step of derivation.
|
void |
visit(XSSimpleTypeVisitor visitor) |
apply, apply, asComplexType, asEmpty, asList, asParticle, asSimpleType, asUnion, getBaseListType, getBaseType, getBaseUnionType, getContentType, getDerivationMethod, getRedefinedBy, getRedefinedCount, getSimpleBaseType, getType, isComplexType, isDerivedFrom, isFinal, isList, isSimpleType, isUnion, listSubstitutables, redefine, visit, visitgetName, getTargetNamespace, isAnonymous, isGlobal, isLocalgetAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitasList, asUnion, getBaseListType, getBaseUnionType, getRedefinedBy, getSimpleBaseType, isFinal, isList, isUnionasComplexType, asSimpleType, getBaseType, getDerivationMethod, getRedefinedCount, isComplexType, isDerivedFrom, isSimpleType, listSubstitutablesgetName, getTargetNamespace, isAnonymous, isGlobal, isLocalapply, getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle, visitapply, asEmpty, asParticle, asSimpleType, visitprivate final java.util.List<XSFacet> facets
public RestrictionSimpleTypeImpl(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 void addFacet(XSFacet facet)
public java.util.Iterator<XSFacet> iterateDeclaredFacets()
XSRestrictionSimpleTypeiterateDeclaredFacets in interface XSRestrictionSimpleTypepublic java.util.Collection<? extends XSFacet> getDeclaredFacets()
XSRestrictionSimpleTypegetDeclaredFacets in interface XSRestrictionSimpleTypepublic XSFacet getDeclaredFacet(java.lang.String name)
XSRestrictionSimpleTypeThis 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 XSRestrictionSimpleTypepublic java.util.List<XSFacet> getDeclaredFacets(java.lang.String name)
XSRestrictionSimpleTypegetDeclaredFacets in interface XSRestrictionSimpleTypepublic XSFacet getFacet(java.lang.String name)
XSSimpleTypeFor 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 XSSimpleTypepublic java.util.List<XSFacet> getFacets(java.lang.String name)
XSSimpleTypegetFacets in interface XSSimpleTypeXSSimpleType.getFacet(String)public XSVariety getVariety()
XSSimpleTypegetVariety in interface XSSimpleTypepublic XSSimpleType getPrimitiveType()
XSSimpleTypeXSSimpleType if
this type is atomic.getPrimitiveType in interface XSSimpleTypepublic boolean isPrimitive()
XSSimpleTypeisPrimitive in interface XSSimpleTypeisPrimitive in class SimpleTypeImplpublic void visit(XSSimpleTypeVisitor visitor)
visit in interface XSSimpleTypepublic java.lang.Object apply(XSSimpleTypeFunction function)
apply in interface XSSimpleTypepublic boolean isRestriction()
XSSimpleTypethis instanceof XSRestrictionSimpleType.isRestriction in interface XSSimpleTypeisRestriction in class SimpleTypeImplpublic XSRestrictionSimpleType asRestriction()
asRestriction in interface XSSimpleTypeasRestriction in class SimpleTypeImpl