Package com.sun.xml.xsom.impl
Class SchemaSetImpl.AnyType
- java.lang.Object
-
- com.sun.xml.xsom.impl.ComponentImpl
-
- com.sun.xml.xsom.impl.DeclarationImpl
-
- com.sun.xml.xsom.impl.SchemaSetImpl.AnyType
-
- All Implemented Interfaces:
Ref.Type
,XSAttContainer
,XSComplexType
,XSComponent
,XSDeclaration
,XSType
- Enclosing class:
- SchemaSetImpl
private class SchemaSetImpl.AnyType extends DeclarationImpl implements XSComplexType, Ref.Type
-
-
Field Summary
Fields Modifier and Type Field Description private WildcardImpl
anyWildcard
private XSContentType
contentType
-
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
Constructors Constructor Description AnyType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
apply(XSFunction<T> f)
Accepts a functor.XSComplexType
asComplexType()
Casts this object to XSComplexType if possible, otherwise returns null.XSContentType
asEmpty()
XSSimpleType
asSimpleType()
Casts this object to XSSimpleType if possible, otherwise returns null.java.util.Collection<? extends XSAttGroupDecl>
getAttGroups()
Iterates all AttGroups which are directly referenced from this component.XSAttributeUse
getAttributeUse(java.lang.String nsURI, java.lang.String localName)
Looks for the attribute use with the specified name from all the attribute uses that are directly/indirectly referenced from this component.java.util.Collection<XSAttributeUse>
getAttributeUses()
Gets all the attribute uses.XSWildcard
getAttributeWildcard()
XSType
getBaseType()
Returns the base type of this type.XSContentType
getContentType()
The content of this complex type.XSAttributeUse
getDeclaredAttributeUse(java.lang.String nsURI, java.lang.String localName)
Looks for the attribute use with the specified name from the attribute uses which are declared in this complex type.java.util.Collection<? extends XSAttributeUse>
getDeclaredAttributeUses()
Lists all the attribute uses that are declared in this complex type.int
getDerivationMethod()
java.util.List<XSElementDecl>
getElementDecls()
Returns a list of element declarations of this type.XSContentType
getExplicitContent()
Gets the explicit content of a complex type with a complex content that was derived by extension.SchemaImpl
getOwnerSchema()
Gets a reference to theXSSchema
object to which this component belongs.XSComplexType
getRedefinedBy()
If thisXSComplexType
is redefined by another complex type, return that component.int
getRedefinedCount()
Returns the number of complex types that redefine this component.XSElementDecl
getScope()
Gets the scope of this complex type.java.util.List<XSComplexType>
getSubtypes()
Returns a list of direct subtypes of this complex type.XSType
getType()
Obtains a reference as a type.boolean
isAbstract()
Checks if this complex type is declared as an abstract type.boolean
isComplexType()
Returns true ifthis instanceof XSComplexType
.boolean
isDerivedFrom(XSType t)
Returns true if this type is derived from the specified type.boolean
isFinal(int i)
boolean
isMixed()
boolean
isSimpleType()
Returns true ifthis instanceof XSSimpleType
.boolean
isSubstitutionProhibited(int i)
Roughly corresponds to the block attribute.java.util.Iterator<XSAttGroupDecl>
iterateAttGroups()
Iterates all AttGroups which are directly referenced from this component.java.util.Iterator<XSAttributeUse>
iterateAttributeUses()
Lists all the attribute uses that are directly/indirectly referenced from this component.java.util.Iterator<XSAttributeUse>
iterateDeclaredAttributeUses()
Lists all the attribute uses that are declared in this complex type.XSType[]
listSubstitutables()
Lists up types that can substitute this type by using xsi:type.void
visit(XSVisitor visitor)
Accepts a visitor.-
Methods inherited from class com.sun.xml.xsom.impl.DeclarationImpl
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
-
Methods inherited from class com.sun.xml.xsom.impl.ComponentImpl
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, 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.XSComponent
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getRoot, getSourceDocument, select, selectSingle
-
Methods inherited from interface com.sun.xml.xsom.XSDeclaration
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
-
-
-
-
Field Detail
-
anyWildcard
private final WildcardImpl anyWildcard
-
contentType
private final XSContentType contentType
-
-
Method Detail
-
getOwnerSchema
public SchemaImpl getOwnerSchema()
Description copied from interface:XSComponent
Gets a reference to theXSSchema
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 interfaceXSComponent
- Overrides:
getOwnerSchema
in classComponentImpl
-
isAbstract
public boolean isAbstract()
Description copied from interface:XSComplexType
Checks if this complex type is declared as an abstract type.- Specified by:
isAbstract
in interfaceXSComplexType
-
getAttributeWildcard
public XSWildcard getAttributeWildcard()
- Specified by:
getAttributeWildcard
in interfaceXSAttContainer
-
getAttributeUse
public XSAttributeUse getAttributeUse(java.lang.String nsURI, java.lang.String localName)
Description copied from interface:XSAttContainer
Looks for the attribute use with the specified name from all the attribute uses that are directly/indirectly referenced from this component.This is the exact implementation of the "attribute use" schema component.
- Specified by:
getAttributeUse
in interfaceXSAttContainer
-
iterateAttributeUses
public java.util.Iterator<XSAttributeUse> iterateAttributeUses()
Description copied from interface:XSAttContainer
Lists all the attribute uses that are directly/indirectly referenced from this component.This is the exact implementation of the "attribute use" schema component.
- Specified by:
iterateAttributeUses
in interfaceXSAttContainer
-
getDeclaredAttributeUse
public XSAttributeUse getDeclaredAttributeUse(java.lang.String nsURI, java.lang.String localName)
Description copied from interface:XSAttContainer
Looks for the attribute use with the specified name from the attribute uses which are declared in this complex type. This does not include att uses declared in att groups that are referenced from this complex type, nor does include att uses declared in base types.- Specified by:
getDeclaredAttributeUse
in interfaceXSAttContainer
-
iterateDeclaredAttributeUses
public java.util.Iterator<XSAttributeUse> iterateDeclaredAttributeUses()
Description copied from interface:XSAttContainer
Lists all the attribute uses that are declared in this complex type.- Specified by:
iterateDeclaredAttributeUses
in interfaceXSAttContainer
-
iterateAttGroups
public java.util.Iterator<XSAttGroupDecl> iterateAttGroups()
Description copied from interface:XSAttContainer
Iterates all AttGroups which are directly referenced from this component.- Specified by:
iterateAttGroups
in interfaceXSAttContainer
-
getAttributeUses
public java.util.Collection<XSAttributeUse> getAttributeUses()
Description copied from interface:XSAttContainer
Gets all the attribute uses.- Specified by:
getAttributeUses
in interfaceXSAttContainer
-
getDeclaredAttributeUses
public java.util.Collection<? extends XSAttributeUse> getDeclaredAttributeUses()
Description copied from interface:XSAttContainer
Lists all the attribute uses that are declared in this complex type.- Specified by:
getDeclaredAttributeUses
in interfaceXSAttContainer
-
getAttGroups
public java.util.Collection<? extends XSAttGroupDecl> getAttGroups()
Description copied from interface:XSAttContainer
Iterates all AttGroups which are directly referenced from this component.- Specified by:
getAttGroups
in interfaceXSAttContainer
-
isFinal
public boolean isFinal(int i)
- Specified by:
isFinal
in interfaceXSComplexType
-
isSubstitutionProhibited
public boolean isSubstitutionProhibited(int i)
Description copied from interface:XSComplexType
Roughly corresponds to the block attribute. But see the spec for gory detail.- Specified by:
isSubstitutionProhibited
in interfaceXSComplexType
-
isMixed
public boolean isMixed()
- Specified by:
isMixed
in interfaceXSComplexType
-
getContentType
public XSContentType getContentType()
Description copied from interface:XSComplexType
The content of this complex type.- Specified by:
getContentType
in interfaceXSComplexType
- Returns:
- always non-null.
-
getExplicitContent
public XSContentType getExplicitContent()
Description copied from interface:XSComplexType
Gets the explicit content of a complex type with a complex content that was derived by extension.Informally, the "explicit content" is the portion of the content model added in this derivation. IOW, it's a delta between the base complex type and this complex type.
For example, when a complex type T2 derives fom T1, then:
content type of T2 = SEQUENCE( content type of T1, explicit content of T2 )
- Specified by:
getExplicitContent
in interfaceXSComplexType
- Returns:
- If this complex type is derived by restriction or has a simple content, this method returns null. IOW, this method only works for a complex type with a complex content derived by extension from another complex type.
-
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 interfaceXSType
- Returns:
- always non-null.
-
asSimpleType
public XSSimpleType asSimpleType()
Description copied from interface:XSType
Casts this object to XSSimpleType if possible, otherwise returns null.- Specified by:
asSimpleType
in interfaceXSType
-
asComplexType
public XSComplexType asComplexType()
Description copied from interface:XSType
Casts this object to XSComplexType if possible, otherwise returns null.- Specified by:
asComplexType
in interfaceXSType
-
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 interfaceXSType
-
isSimpleType
public boolean isSimpleType()
Description copied from interface:XSType
Returns true ifthis instanceof XSSimpleType
.- Specified by:
isSimpleType
in interfaceXSType
-
isComplexType
public boolean isComplexType()
Description copied from interface:XSType
Returns true ifthis instanceof XSComplexType
.- Specified by:
isComplexType
in interfaceXSType
-
asEmpty
public XSContentType asEmpty()
-
getDerivationMethod
public int getDerivationMethod()
- Specified by:
getDerivationMethod
in interfaceXSType
-
getScope
public XSElementDecl getScope()
Description copied from interface:XSComplexType
Gets the scope of this complex type. This is not a property defined in the schema spec.- Specified by:
getScope
in interfaceXSComplexType
- Returns:
- null if this complex type is global. Otherwise return the element declaration that contains this anonymous complex type.
-
visit
public void visit(XSVisitor visitor)
Description copied from interface:XSComponent
Accepts a visitor.- Specified by:
visit
in interfaceXSComponent
-
apply
public <T> T apply(XSFunction<T> f)
Description copied from interface:XSComponent
Accepts a functor.- Specified by:
apply
in interfaceXSComponent
-
getType
public XSType getType()
Description copied from interface:Ref.Type
Obtains a reference as a type.
-
getRedefinedBy
public XSComplexType getRedefinedBy()
Description copied from interface:XSComplexType
If thisXSComplexType
is redefined by another complex type, return that component.- Specified by:
getRedefinedBy
in interfaceXSComplexType
- Specified by:
getRedefinedBy
in interfaceXSType
- 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 interfaceXSType
-
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 interfaceXSType
-
getSubtypes
public java.util.List<XSComplexType> getSubtypes()
Description copied from interface:XSComplexType
Returns a list of direct subtypes of this complex type. If the type is not subtyped, returns empty list. Doesn't return null. Note that the complex type may be extended outside of the scope of the schemaset known to XSOM.- Specified by:
getSubtypes
in interfaceXSComplexType
- Returns:
-
getElementDecls
public java.util.List<XSElementDecl> getElementDecls()
Description copied from interface:XSComplexType
Returns a list of element declarations of this type.- Specified by:
getElementDecls
in interfaceXSComplexType
- Returns:
-
-