Class SchemaSetImpl.AnySimpleType

java.lang.Object
com.sun.xml.xsom.impl.ComponentImpl
com.sun.xml.xsom.impl.SchemaSetImpl.AnySimpleType
All Implemented Interfaces:
Ref.SimpleType, Ref.Type, XSComponent, XSContentType, XSDeclaration, XSRestrictionSimpleType, XSSimpleType, XSType
Enclosing class:
SchemaSetImpl

public class SchemaSetImpl.AnySimpleType extends ComponentImpl implements XSRestrictionSimpleType, Ref.SimpleType
  • Method Details

    • getOwnerSchema

      public SchemaImpl getOwnerSchema()
      Description copied from interface: XSComponent
      Gets a reference to the XSSchema object to which this component belongs.

      In case of XSEmpty component, this method returns null since there is no owner component.

      Specified by:
      getOwnerSchema in interface XSComponent
      Overrides:
      getOwnerSchema in class ComponentImpl
    • asSimpleType

      public XSSimpleType asSimpleType()
      Description copied from interface: XSType
      Casts this object to XSSimpleType if possible, otherwise returns null.
      Specified by:
      asSimpleType in interface XSContentType
      Specified by:
      asSimpleType in interface XSType
    • asComplexType

      public XSComplexType asComplexType()
      Description copied from interface: XSType
      Casts this object to XSComplexType if possible, otherwise returns null.
      Specified by:
      asComplexType in interface XSType
    • isDerivedFrom

      public boolean isDerivedFrom(XSType t)
      Description copied from interface: XSType
      Returns true if this type is derived from the specified type.

      Note that t.isDerivedFrom(t) returns true.

      Specified by:
      isDerivedFrom in interface XSType
    • isSimpleType

      public boolean isSimpleType()
      Description copied from interface: XSType
      Returns true if this instanceof XSSimpleType.
      Specified by:
      isSimpleType in interface XSType
    • isComplexType

      public boolean isComplexType()
      Description copied from interface: XSType
      Returns true if this instanceof XSComplexType.
      Specified by:
      isComplexType in interface XSType
    • asEmpty

      public XSContentType asEmpty()
      Description copied from interface: XSContentType
      If this content type represents the empty content, return this, otherwise null.
      Specified by:
      asEmpty in interface XSContentType
    • asParticle

      public XSParticle asParticle()
      Description copied from interface: XSContentType
      Equivalent of (this instanceof XSParticle)?this:null
      Specified by:
      asParticle in interface XSContentType
    • getBaseType

      public XSType getBaseType()
      Description copied from interface: XSType
      Returns the base type of this type. Note that if this type represents xs:anyType, this method returns itself. This is awkward as an API, but it follows the schema specification.
      Specified by:
      getBaseType in interface XSType
      Returns:
      always non-null.
    • getSimpleBaseType

      public XSSimpleType getSimpleBaseType()
      Description copied from interface: XSSimpleType
      Gets the base type as XSSimpleType. Equivalent to (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.
      Specified by:
      getSimpleBaseType in interface XSSimpleType
      Returns:
      null if this is xs:anySimpleType. Otherwise non-null.
    • getDerivationMethod

      public int getDerivationMethod()
      Specified by:
      getDerivationMethod in interface XSType
    • iterateDeclaredFacets

      public Iterator<XSFacet> iterateDeclaredFacets()
      Description copied from interface: XSRestrictionSimpleType
      Iterates facets that are specified in this step of derivation.
      Specified by:
      iterateDeclaredFacets in interface XSRestrictionSimpleType
    • getDeclaredFacets

      public Collection<? extends XSFacet> getDeclaredFacets()
      Description copied from interface: XSRestrictionSimpleType
      Gets all the facets that are declared on this restriction.
      Specified by:
      getDeclaredFacets in interface XSRestrictionSimpleType
      Returns:
      Can be empty but always non-null.
    • visit

      public void visit(XSSimpleTypeVisitor visitor)
      Specified by:
      visit in interface XSSimpleType
    • visit

      public void visit(XSContentTypeVisitor visitor)
      Specified by:
      visit in interface XSContentType
    • visit

      public void visit(XSVisitor visitor)
      Description copied from interface: XSComponent
      Accepts a visitor.
      Specified by:
      visit in interface XSComponent
    • apply

      public <T> T apply(XSSimpleTypeFunction<T> f)
      Specified by:
      apply in interface XSSimpleType
    • apply

      public <T> T apply(XSContentTypeFunction<T> f)
      Specified by:
      apply in interface XSContentType
    • apply

      public <T> T apply(XSFunction<T> f)
      Description copied from interface: XSComponent
      Accepts a functor.
      Specified by:
      apply in interface XSComponent
    • getVariety

      public XSVariety getVariety()
      Description copied from interface: XSSimpleType
      Gets the variety of this simple type.
      Specified by:
      getVariety in interface XSSimpleType
    • getPrimitiveType

      public XSSimpleType getPrimitiveType()
      Description copied from interface: XSSimpleType
      Gets the ancestor primitive if this type is atomic.
      Specified by:
      getPrimitiveType in interface XSSimpleType
      Returns:
      null otherwise.
    • isPrimitive

      public boolean isPrimitive()
      Description copied from interface: XSSimpleType
      Returns true if this is a primitive built-in simple type (that directly derives from xs:anySimpleType, by definition.)
      Specified by:
      isPrimitive in interface XSSimpleType
    • getBaseListType

      public XSListSimpleType getBaseListType()
      Description copied from interface: XSSimpleType
      Gets the nearest ancestor XSListSimpleType (including itself) if the variety of this type is list.
      Specified by:
      getBaseListType in interface XSSimpleType
      Returns:
      otherwise return null
    • getBaseUnionType

      public XSUnionSimpleType getBaseUnionType()
      Description copied from interface: XSSimpleType
      Gets the nearest ancestor XSUnionSimpleType (including itself) if the variety of this type is union.
      Specified by:
      getBaseUnionType in interface XSSimpleType
      Returns:
      otherwise return null
    • getFacet

      public XSFacet getFacet(String name)
      Description copied from interface: XSSimpleType
      Gets 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:
      getFacet in interface XSSimpleType
      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

      public List<XSFacet> getFacets(String name)
      Description copied from interface: XSSimpleType
      For multi-valued facets (enumeration and pattern), obtain all values.
      Specified by:
      getFacets in interface XSSimpleType
      Returns:
      can be empty but never null.
      See Also:
    • getDeclaredFacet

      public XSFacet getDeclaredFacet(String name)
      Description copied from interface: XSRestrictionSimpleType
      Gets 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:
      getDeclaredFacet in interface XSRestrictionSimpleType
      Returns:
      Null if the facet is not specified in the last step of derivation.
    • getDeclaredFacets

      public List<XSFacet> getDeclaredFacets(String name)
      Description copied from interface: XSRestrictionSimpleType
      Gets 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:
      getDeclaredFacets in interface XSRestrictionSimpleType
      Returns:
      can be empty but never be null.
    • isRestriction

      public boolean isRestriction()
      Description copied from interface: XSSimpleType
      Returns true if this instanceof XSRestrictionSimpleType.
      Specified by:
      isRestriction in interface XSSimpleType
    • isList

      public boolean isList()
      Description copied from interface: XSSimpleType
      Returns true if this instanceof XSListSimpleType.
      Specified by:
      isList in interface XSSimpleType
    • isUnion

      public boolean isUnion()
      Description copied from interface: XSSimpleType
      Returns true if this instanceof XSUnionSimpleType.
      Specified by:
      isUnion in interface XSSimpleType
    • isFinal

      public boolean isFinal(XSVariety v)
      Description copied from interface: XSSimpleType
      Returns true if this type definition is marked as 'final' with respect to the given XSVariety.
      Specified by:
      isFinal in interface XSSimpleType
      Returns:
      true if the type is marked final.
    • asRestriction

      public XSRestrictionSimpleType asRestriction()
      Specified by:
      asRestriction in interface XSSimpleType
    • asList

      public XSListSimpleType asList()
      Specified by:
      asList in interface XSSimpleType
    • asUnion

      public XSUnionSimpleType asUnion()
      Specified by:
      asUnion in interface XSSimpleType
    • getType

      public XSSimpleType getType()
      Description copied from interface: Ref.Type
      Obtains a reference as a type.
      Specified by:
      getType in interface Ref.SimpleType
      Specified by:
      getType in interface Ref.Type
    • getRedefinedBy

      public XSSimpleType getRedefinedBy()
      Description copied from interface: XSSimpleType
      If this is redefined by another simple type, return that component.
      Specified by:
      getRedefinedBy in interface XSSimpleType
      Specified by:
      getRedefinedBy in interface XSType
      Returns:
      null if this component has not been redefined.
    • getRedefinedCount

      public int getRedefinedCount()
      Description copied from interface: XSType
      Returns the number of complex types that redefine this component.

      For example, if A is redefined by B and B is redefined by C, A.getRedefinedCount()==2, B.getRedefinedCount()==1, and C.getRedefinedCount()==0.

      Specified by:
      getRedefinedCount in interface XSType
    • listSubstitutables

      public XSType[] listSubstitutables()
      Description copied from interface: XSType
      Lists up types that can substitute this type by using xsi:type. Includes this type itself.

      This method honors the block flag.

      Specified by:
      listSubstitutables in interface XSType
    • getName

      public String getName()
      Description copied from interface: XSDeclaration
      Gets the (local) name of the declaration.
      Specified by:
      getName in interface XSDeclaration
      Returns:
      null if this component is anonymous.
    • getTargetNamespace

      public String getTargetNamespace()
      Description copied from interface: XSDeclaration
      Target namespace to which this component belongs. "" is used to represent the default no namespace.
      Specified by:
      getTargetNamespace in interface XSDeclaration
    • isAnonymous

      @Deprecated public boolean isAnonymous()
      Deprecated.
      Specified by:
      isAnonymous in interface XSDeclaration
    • isGlobal

      public final boolean isGlobal()
      Description copied from interface: XSDeclaration
      Returns true if this declaration is a global declaration. Global declarations are those declaration that can be enumerated through the schema object.
      Specified by:
      isGlobal in interface XSDeclaration
    • isLocal

      public final boolean isLocal()
      Description copied from interface: XSDeclaration
      Returns true if this declaration is a local declaration. Equivalent of !isGlobal()
      Specified by:
      isLocal in interface XSDeclaration