Package com.sun.xml.xsom.impl
Class ComplexTypeImpl
java.lang.Object
com.sun.xml.xsom.impl.ComponentImpl
com.sun.xml.xsom.impl.AttributesHolder
com.sun.xml.xsom.impl.ComplexTypeImpl
- All Implemented Interfaces:
Ref.ComplexType,Ref.Type,XSAttContainer,XSComplexType,XSComponent,XSDeclaration,XSType
-
Field Summary
Fields inherited from class com.sun.xml.xsom.impl.AttributesHolder
attGroups, attributes, prohibitedAttsFields inherited from class com.sun.xml.xsom.impl.ComponentImpl
ownerDocumentFields inherited from interface com.sun.xml.xsom.XSType
EXTENSION, RESTRICTION, SUBSTITUTION -
Constructor Summary
ConstructorsConstructorDescriptionComplexTypeImpl(SchemaDocumentImpl _parent, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa, String _name, boolean _anonymous, boolean _abstract, int _derivationMethod, Ref.Type _base, int _final, int _block, boolean _mixed) -
Method Summary
Modifier and TypeMethodDescription<T> Tapply(XSFunction<T> function) Accepts a functor.Casts this object to XSComplexType if possible, otherwise returns null.Casts this object to XSSimpleType if possible, otherwise returns null.getAttributeUse(String nsURI, String localName) Looks for the attribute use with the specified name from all the attribute uses that are directly/indirectly referenced from this component.Returns the attribute uses by looking at attribute groups and etc.Returns the base type of this type.The content of this complex type.intReturns a list of element declarations of this type.Gets the explicit content of a complex type with a complex content that was derived by extension.getName()Gets the (local) name of the declaration.If thisXSComplexTypeis redefined by another complex type, return that component.intReturns the number of complex types that redefine this component.getScope()Gets the scope of this complex type.Returns a list of direct subtypes of this complex type.Target namespace to which this component belongs.getType()Obtains a reference as a type.booleanChecks if this complex type is declared as an abstract type.booleanDeprecated.final booleanReturns true ifthis instanceof XSComplexType.booleanReturns true if this type is derived from the specified type.booleanisFinal(int derivationMethod) final booleanisGlobal()Returns true if this declaration is a global declaration.final booleanisLocal()Returns true if this declaration is a local declaration.booleanisMixed()final booleanReturns true ifthis instanceof XSSimpleType.booleanisSubstitutionProhibited(int method) Roughly corresponds to the block attribute.Lists all the attribute uses that are directly/indirectly referenced from this component.XSType[]Lists up types that can substitute this type by using xsi:type.voidCalled when this complex type redefines the specified complex type.voidvoidvoidsetScope(XSElementDecl _scope) voidSet the local attribute wildcard.voidAccepts a visitor.Methods inherited from class com.sun.xml.xsom.impl.AttributesHolder
addAttGroup, addAttributeUse, addProhibitedAttribute, getAttGroups, getDeclaredAttributeUse, getDeclaredAttributeUses, iterateAttGroups, iterateDeclaredAttributeUsesMethods 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.XSAttContainer
getAttGroups, getDeclaredAttributeUse, getDeclaredAttributeUses, iterateAttGroups, iterateDeclaredAttributeUsesMethods inherited from interface com.sun.xml.xsom.XSComponent
getAnnotation, getAnnotation, getForeignAttribute, getForeignAttributes, getLocator, getOwnerSchema, getRoot, getSourceDocument, select, selectSingleMethods inherited from interface com.sun.xml.xsom.XSDeclaration
getName, getTargetNamespace, isAnonymous, isGlobal, isLocal
-
Constructor Details
-
ComplexTypeImpl
public ComplexTypeImpl(SchemaDocumentImpl _parent, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa, String _name, boolean _anonymous, boolean _abstract, int _derivationMethod, Ref.Type _base, int _final, int _block, boolean _mixed)
-
-
Method Details
-
asComplexType
Description copied from interface:XSTypeCasts this object to XSComplexType if possible, otherwise returns null.- Specified by:
asComplexTypein interfaceXSType
-
isDerivedFrom
Description copied from interface:XSTypeReturns true if this type is derived from the specified type.Note that
t.isDerivedFrom(t)returns true.- Specified by:
isDerivedFromin interfaceXSType
-
asSimpleType
Description copied from interface:XSTypeCasts this object to XSSimpleType if possible, otherwise returns null.- Specified by:
asSimpleTypein interfaceXSType
-
isSimpleType
public final boolean isSimpleType()Description copied from interface:XSTypeReturns true ifthis instanceof XSSimpleType.- Specified by:
isSimpleTypein interfaceXSType
-
isComplexType
public final boolean isComplexType()Description copied from interface:XSTypeReturns true ifthis instanceof XSComplexType.- Specified by:
isComplexTypein interfaceXSType
-
getDerivationMethod
public int getDerivationMethod()- Specified by:
getDerivationMethodin interfaceXSType
-
getBaseType
Description copied from interface:XSTypeReturns the base type of this type. Note that if this type representsxs:anyType, this method returns itself. This is awkward as an API, but it follows the schema specification.- Specified by:
getBaseTypein interfaceXSType- Returns:
- always non-null.
-
redefine
Called when this complex type redefines the specified complex type. -
getRedefinedBy
Description copied from interface:XSComplexTypeIf thisXSComplexTypeis redefined by another complex type, return that component.- Specified by:
getRedefinedByin interfaceXSComplexType- Specified by:
getRedefinedByin interfaceXSType- Returns:
- null if this component has not been redefined.
-
getRedefinedCount
public int getRedefinedCount()Description copied from interface:XSTypeReturns 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:
getRedefinedCountin interfaceXSType
-
getScope
Description copied from interface:XSComplexTypeGets the scope of this complex type. This is not a property defined in the schema spec.- Specified by:
getScopein interfaceXSComplexType- Returns:
- null if this complex type is global. Otherwise return the element declaration that contains this anonymous complex type.
-
setScope
-
isAbstract
public boolean isAbstract()Description copied from interface:XSComplexTypeChecks if this complex type is declared as an abstract type.- Specified by:
isAbstractin interfaceXSComplexType
-
setWildcard
Set the local attribute wildcard.- Specified by:
setWildcardin classAttributesHolder
-
getAttributeWildcard
- Specified by:
getAttributeWildcardin interfaceXSAttContainer
-
isFinal
public boolean isFinal(int derivationMethod) - Specified by:
isFinalin interfaceXSComplexType
-
isSubstitutionProhibited
public boolean isSubstitutionProhibited(int method) Description copied from interface:XSComplexTypeRoughly corresponds to the block attribute. But see the spec for gory detail.- Specified by:
isSubstitutionProhibitedin interfaceXSComplexType
-
setContentType
-
getContentType
Description copied from interface:XSComplexTypeThe content of this complex type.- Specified by:
getContentTypein interfaceXSComplexType- Returns:
- always non-null.
-
setExplicitContent
-
getExplicitContent
Description copied from interface:XSComplexTypeGets 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:
getExplicitContentin 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.
-
isMixed
public boolean isMixed()- Specified by:
isMixedin interfaceXSComplexType
-
getAttributeUse
Description copied from interface:XSAttContainerLooks 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:
getAttributeUsein interfaceXSAttContainer
-
iterateAttributeUses
Description copied from interface:XSAttContainerLists 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:
iterateAttributeUsesin interfaceXSAttContainer- Overrides:
iterateAttributeUsesin classAttributesHolder
-
getAttributeUses
Description copied from class:AttributesHolderReturns the attribute uses by looking at attribute groups and etc. Searching for the base type is done inComplexTypeImpl.- Specified by:
getAttributeUsesin interfaceXSAttContainer- Overrides:
getAttributeUsesin classAttributesHolder
-
listSubstitutables
Description copied from interface:XSTypeLists up types that can substitute this type by using xsi:type. Includes this type itself.This method honors the block flag.
- Specified by:
listSubstitutablesin interfaceXSType
-
visit
Description copied from interface:XSComponentAccepts a visitor.- Specified by:
visitin interfaceXSComponent
-
apply
Description copied from interface:XSComponentAccepts a functor.- Specified by:
applyin interfaceXSComponent
-
getType
Description copied from interface:Ref.TypeObtains a reference as a type.- Specified by:
getTypein interfaceRef.ComplexType- Specified by:
getTypein interfaceRef.Type
-
getSubtypes
Description copied from interface:XSComplexTypeReturns 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:
getSubtypesin interfaceXSComplexType- Returns:
-
getElementDecls
Description copied from interface:XSComplexTypeReturns a list of element declarations of this type.- Specified by:
getElementDeclsin interfaceXSComplexType- Returns:
-
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
-