Class RestrictionSimpleTypeImpl
- All Implemented Interfaces:
ContentTypeImpl,Ref.ContentType,Ref.SimpleType,Ref.Type,XSComponent,XSContentType,XSDeclaration,XSRestrictionSimpleType,XSSimpleType,XSType
-
Field Summary
Fields inherited from class com.sun.xml.xsom.impl.ComponentImpl
ownerDocumentFields inherited from interface com.sun.xml.xsom.XSType
EXTENSION, RESTRICTION, SUBSTITUTION -
Constructor Summary
ConstructorsConstructorDescriptionRestrictionSimpleTypeImpl(SchemaDocumentImpl _parent, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa, String _name, boolean _anonymous, Set<XSVariety> finalSet, Ref.SimpleType _baseType) -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(XSSimpleTypeFunction function) 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.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 the ancestor primitiveXSSimpleTypeif this type isatomic.Target namespace to which this component belongs.Gets the variety of this simple type.booleanDeprecated.final booleanisGlobal()Returns true if this declaration is a global declaration.final booleanisLocal()Returns true if this declaration is a local declaration.booleanReturns true if this is a primitive built-in simple type (that directly derives from xs:anySimpleType, by definition.)booleanReturns true ifthis instanceof XSRestrictionSimpleType.Iterates facets that are specified in this step of derivation.voidvisit(XSSimpleTypeVisitor visitor) Methods inherited from class com.sun.xml.xsom.impl.SimpleTypeImpl
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, visitMethods inherited from class com.sun.xml.xsom.impl.ComponentImpl
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.sun.xml.xsom.XSComponent
apply, getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle, visitMethods inherited from interface com.sun.xml.xsom.XSContentType
apply, asEmpty, asParticle, asSimpleType, visitMethods inherited from interface com.sun.xml.xsom.XSDeclaration
getName, getTargetNamespace, isAnonymous, isGlobal, isLocalMethods inherited from interface com.sun.xml.xsom.XSSimpleType
asList, asUnion, getBaseListType, getBaseUnionType, getRedefinedBy, getSimpleBaseType, isFinal, isList, isUnionMethods inherited from interface com.sun.xml.xsom.XSType
asComplexType, asSimpleType, getBaseType, getDerivationMethod, getRedefinedCount, isComplexType, isDerivedFrom, isSimpleType, listSubstitutables
-
Constructor Details
-
RestrictionSimpleTypeImpl
public RestrictionSimpleTypeImpl(SchemaDocumentImpl _parent, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa, String _name, boolean _anonymous, Set<XSVariety> finalSet, Ref.SimpleType _baseType)
-
-
Method Details
-
addFacet
-
iterateDeclaredFacets
Description copied from interface:XSRestrictionSimpleTypeIterates facets that are specified in this step of derivation.- Specified by:
iterateDeclaredFacetsin interfaceXSRestrictionSimpleType
-
getDeclaredFacets
Description copied from interface:XSRestrictionSimpleTypeGets all the facets that are declared on this restriction.- Specified by:
getDeclaredFacetsin interfaceXSRestrictionSimpleType- Returns:
- Can be empty but always non-null.
-
getDeclaredFacet
Description copied from interface:XSRestrictionSimpleTypeGets 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:
getDeclaredFacetin interfaceXSRestrictionSimpleType- Returns:
- Null if the facet is not specified in the last step of derivation.
-
getDeclaredFacets
Description copied from interface:XSRestrictionSimpleTypeGets 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:
getDeclaredFacetsin interfaceXSRestrictionSimpleType- Returns:
- can be empty but never be null.
-
getFacet
Description copied from interface:XSSimpleTypeGets 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:
getFacetin 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:XSSimpleTypeFor multi-valued facets (enumeration and pattern), obtain all values.- Specified by:
getFacetsin interfaceXSSimpleType- Returns:
- can be empty but never null.
- See Also:
-
getVariety
Description copied from interface:XSSimpleTypeGets the variety of this simple type.- Specified by:
getVarietyin interfaceXSSimpleType
-
getPrimitiveType
Description copied from interface:XSSimpleTypeGets the ancestor primitiveXSSimpleTypeif this type isatomic.- Specified by:
getPrimitiveTypein interfaceXSSimpleType- Returns:
- null otherwise.
-
isPrimitive
public boolean isPrimitive()Description copied from interface:XSSimpleTypeReturns true if this is a primitive built-in simple type (that directly derives from xs:anySimpleType, by definition.)- Specified by:
isPrimitivein interfaceXSSimpleType- Overrides:
isPrimitivein classSimpleTypeImpl
-
visit
- Specified by:
visitin interfaceXSSimpleType
-
apply
- Specified by:
applyin interfaceXSSimpleType
-
isRestriction
public boolean isRestriction()Description copied from interface:XSSimpleTypeReturns true ifthis instanceof XSRestrictionSimpleType.- Specified by:
isRestrictionin interfaceXSSimpleType- Overrides:
isRestrictionin classSimpleTypeImpl
-
asRestriction
- Specified by:
asRestrictionin interfaceXSSimpleType- Overrides:
asRestrictionin classSimpleTypeImpl
-
getName
Description copied from interface:XSDeclarationGets the (local) name of the declaration.- Specified by:
getNamein interfaceXSDeclaration- Returns:
- null if this component is anonymous.
-
getTargetNamespace
Description copied from interface:XSDeclarationTarget namespace to which this component belongs.""is used to represent the default no namespace.- Specified by:
getTargetNamespacein interfaceXSDeclaration
-
isAnonymous
public boolean isAnonymous()Deprecated.- Specified by:
isAnonymousin interfaceXSDeclaration
-
isGlobal
public final boolean isGlobal()Description copied from interface:XSDeclarationReturns true if this declaration is a global declaration. Global declarations are those declaration that can be enumerated through the schema object.- Specified by:
isGlobalin interfaceXSDeclaration
-
isLocal
public final boolean isLocal()Description copied from interface:XSDeclarationReturns true if this declaration is a local declaration. Equivalent of!isGlobal()- Specified by:
isLocalin interfaceXSDeclaration
-