com.sun.xml.xsom.impl
Class UnionSimpleTypeImpl

java.lang.Object
  extended by com.sun.xml.xsom.impl.ComponentImpl
      extended by com.sun.xml.xsom.impl.SimpleTypeImpl
          extended by com.sun.xml.xsom.impl.UnionSimpleTypeImpl
All Implemented Interfaces:
ContentTypeImpl, Ref.ContentType, Ref.SimpleType, Ref.Type, XSComponent, XSContentType, XSDeclaration, XSSimpleType, XSType, XSUnionSimpleType, Iterable<XSSimpleType>

public class UnionSimpleTypeImpl
extends SimpleTypeImpl
implements XSUnionSimpleType


Field Summary
 
Fields inherited from class com.sun.xml.xsom.impl.ComponentImpl
ownerDocument
 
Fields inherited from interface com.sun.xml.xsom.XSType
EXTENSION, RESTRICTION, SUBSTITUTION
 
Constructor Summary
UnionSimpleTypeImpl(SchemaDocumentImpl _parent, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa, String _name, boolean _anonymous, Set<XSVariety> finalSet, Ref.SimpleType[] _members)
           
 
Method Summary
 Object apply(XSSimpleTypeFunction function)
           
 XSUnionSimpleType asUnion()
           
 XSUnionSimpleType getBaseUnionType()
          Gets the nearest ancestor XSUnionSimpleType (including itself) if the variety of this type is union.
 XSFacet getFacet(String name)
          Gets the effective facet object of the given name.
 List<XSFacet> getFacets(String name)
          For multi-valued facets (enumeration and pattern), obtain all values.
 XSSimpleType getMember(int idx)
           
 int getMemberSize()
           
 String getName()
          Gets the (local) name of the declaration.
 XSSimpleType getPrimitiveType()
          Gets the ancestor primitive XSSimpleType if this type is atomic.
 String getTargetNamespace()
          Target namespace to which this component belongs.
 XSVariety getVariety()
          Gets the variety of this simple type.
 boolean isAnonymous()
          Deprecated.  
 boolean isGlobal()
          Returns true if this declaration is a global declaration.
 boolean isLocal()
          Returns true if this declaration is a local declaration.
 boolean isUnion()
          Returns true if this instanceof XSUnionSimpleType.
 Iterator<XSSimpleType> iterator()
           
 void visit(XSSimpleTypeVisitor visitor)
           
 
Methods inherited from class com.sun.xml.xsom.impl.SimpleTypeImpl
apply, apply, asComplexType, asEmpty, asList, asParticle, asRestriction, asSimpleType, getBaseListType, getBaseType, getContentType, getDerivationMethod, getRedefinedBy, getRedefinedCount, getSimpleBaseType, getType, isComplexType, isDerivedFrom, isFinal, isList, isPrimitive, isRestriction, isSimpleType, listSubstitutables, redefine, visit, visit
 
Methods inherited from class com.sun.xml.xsom.impl.ComponentImpl
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.xml.xsom.XSSimpleType
asList, asRestriction, getBaseListType, getRedefinedBy, getSimpleBaseType, isFinal, isList, isPrimitive, isRestriction
 
Methods inherited from interface com.sun.xml.xsom.XSType
asComplexType, asSimpleType, getBaseType, getDerivationMethod, getRedefinedCount, isComplexType, isDerivedFrom, isSimpleType, listSubstitutables
 
Methods inherited from interface com.sun.xml.xsom.XSDeclaration
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
 
Methods inherited from interface com.sun.xml.xsom.XSComponent
apply, getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingle, visit
 
Methods inherited from interface com.sun.xml.xsom.XSContentType
apply, asEmpty, asParticle, asSimpleType, visit
 

Constructor Detail

UnionSimpleTypeImpl

public UnionSimpleTypeImpl(SchemaDocumentImpl _parent,
                           AnnotationImpl _annon,
                           Locator _loc,
                           ForeignAttributesImpl _fa,
                           String _name,
                           boolean _anonymous,
                           Set<XSVariety> finalSet,
                           Ref.SimpleType[] _members)
Method Detail

getMember

public XSSimpleType getMember(int idx)
Specified by:
getMember in interface XSUnionSimpleType

getMemberSize

public int getMemberSize()
Specified by:
getMemberSize in interface XSUnionSimpleType

iterator

public Iterator<XSSimpleType> iterator()
Specified by:
iterator in interface Iterable<XSSimpleType>

visit

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

apply

public Object apply(XSSimpleTypeFunction function)
Specified by:
apply in interface XSSimpleType

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
Overrides:
getBaseUnionType in class SimpleTypeImpl
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:
XSSimpleType.getFacet(String)

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 XSSimpleType if this type is atomic.

Specified by:
getPrimitiveType in interface XSSimpleType
Returns:
null otherwise.

isUnion

public boolean isUnion()
Description copied from interface: XSSimpleType
Returns true if this instanceof XSUnionSimpleType.

Specified by:
isUnion in interface XSSimpleType
Overrides:
isUnion in class SimpleTypeImpl

asUnion

public XSUnionSimpleType asUnion()
Specified by:
asUnion in interface XSSimpleType
Overrides:
asUnion in class SimpleTypeImpl

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

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


Copyright © 2012 Oracle. All Rights Reserved.