Top Description Fields Constructors Methods
org.apache.xerces.impl.xs

public Class XSComplexTypeDecl

extends Object
implements XSComplexTypeDefinition, TypeInfo
Class Inheritance
All Implemented Interfaces
org.w3c.dom.TypeInfo, org.apache.xerces.xs.XSComplexTypeDefinition, org.apache.xerces.xs.XSTypeDefinition, org.apache.xerces.xs.XSObject
Known Direct Subclasses
org.apache.xerces.impl.xs.SchemaGrammar.XSAnyType
Imports
org.apache.xerces.impl.dv.XSSimpleType, org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl, org.apache.xerces.impl.xs.models.CMBuilder, .XSCMValidator, org.apache.xerces.impl.xs.util.XSObjectListImpl, org.apache.xerces.xs.XSAttributeUse, .XSComplexTypeDefinition, .XSConstants, .XSNamespaceItem, .XSObjectList, .XSParticle, .XSSimpleTypeDefinition, .XSTypeDefinition, .XSWildcard, org.w3c.dom.TypeInfo

The XML representation for a complexType schema component is a <complexType> element information item
Authors
Elena Litani, IBM, Sandy Gao, IBM
Version
$Id: XSComplexTypeDecl.java 965250 2010-07-18 16:04:58Z mrglavas $

Field Summary

Modifier and TypeField and Description
private static final short
private static final short
private static final short
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv XSObjectListImpl
pack-priv XSAttributeGroupDecl
pack-priv XSTypeDefinition
pack-priv short
pack-priv XSCMValidator
pack-priv short
pack-priv short
pack-priv short
pack-priv short
pack-priv String
private XSNamespaceItem
pack-priv XSParticleDecl
pack-priv String
pack-priv XSCMValidator
pack-priv XSSimpleType

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv void
public boolean
public boolean
derivedFrom(String
An ancestor type namespace.
ancestorNS
,
String
An ancestor type name.
ancestorName
,
short
A bit combination representing a subset of { DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST }.
derivationMethod
)

Implements org.apache.xerces.xs.XSTypeDefinition.derivedFrom.

Convenience method which checks if this type is derived from the given ancestor type.
public boolean
derivedFromType(XSTypeDefinition
An ancestor type definition.
ancestor
,
short
A bit combination representing a subset of { DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST }.
derivationMethod
)

Implements org.apache.xerces.xs.XSTypeDefinition.derivedFromType.

Convenience method which checks if this type is derived from the given ancestorType.
public boolean
public XSObjectList
public boolean
getAnonymous()

Implements org.apache.xerces.xs.XSTypeDefinition.getAnonymous.

A boolean that specifies if the type definition is anonymous.
public XSAttributeGroupDecl
public XSAttributeUse
getAttributeUse(String namespace, String name)

public XSObjectList
getAttributeUses()

Implements org.apache.xerces.xs.XSComplexTypeDefinition.getAttributeUses.

{attribute uses} A set of attribute uses.
public XSWildcard
public XSTypeDefinition
getBaseType()

Implements org.apache.xerces.xs.XSTypeDefinition.getBaseType.

{base type definition} Either a simple type definition or a complex type definition.
public XSCMValidator
public synchronized XSCMValidator
getContentModel(CMBuilder cmBuilder, boolean forUPA)

public short
getContentType()

Implements org.apache.xerces.xs.XSComplexTypeDefinition.getContentType.

{content type} One of empty, a simple type definition (see simpleType, or mixed, element-only (see cmParticle).
public short
getDerivationMethod()

Implements org.apache.xerces.xs.XSComplexTypeDefinition.getDerivationMethod.

{derivation method} Either extension or restriction.
public short

Returns:

A bit flag that represents: {extension, restriction) or none for complexTypes; {extension, list, restriction, union} or none for simpleTypes;
getFinal
()

Implements org.apache.xerces.xs.XSTypeDefinition.getFinal.

{final} For complex type definition it is a subset of {extension, restriction}.
public short
public String
getName()

Implements org.apache.xerces.xs.XSObject.getName.

The name of this XSObject depending on the XSObject type.
public String
getNamespace()

Implements org.apache.xerces.xs.XSObject.getNamespace.

The namespace URI of this node, or null if it is unspecified.
public XSNamespaceItem
getNamespaceItem()

Implements org.apache.xerces.xs.XSObject.getNamespaceItem.

A namespace schema information item corresponding to the target namespace of the component, if it is globally declared; or null otherwise.
public XSParticle
getParticle()

Implements org.apache.xerces.xs.XSComplexTypeDefinition.getParticle.

A particle for mixed or element-only content model, otherwise null
public short

Returns:

A bit flag corresponding to prohibited substitutions
getProhibitedSubstitutions
()

Implements org.apache.xerces.xs.XSComplexTypeDefinition.getProhibitedSubstitutions.

{prohibited substitutions}
public XSSimpleTypeDefinition
getSimpleType()

Implements org.apache.xerces.xs.XSComplexTypeDefinition.getSimpleType.

A simple type definition corresponding to simple content model, otherwise null
public String
public short
getType()

Implements org.apache.xerces.xs.XSObject.getType.

Get the type of the object, i.e ELEMENT_DECLARATION.
public short
getTypeCategory()

Implements org.apache.xerces.xs.XSTypeDefinition.getTypeCategory.

Return whether this type definition is a simple type or complex type.
public String
getTypeName()

Implements org.w3c.dom.TypeInfo.getTypeName.

The name of a type declared for the associated element or attribute, or null if unknown.
public String
getTypeNamespace()

Implements org.w3c.dom.TypeInfo.getTypeNamespace.

The namespace of the type declared for the associated element or attribute or null if the element does not have declaration or if no namespace information is available.
private boolean

Returns:

boolean True if the type is derived by any method for the reference type
isDerivedByAny
(String
The namspace of the ancestor type declaration
ancestorNS
,
String
The name of the ancestor type declaration
ancestorName
,
int
A short indication the method of derivation
derivationMethod
,
XSTypeDefinition
The reference type definition
type
)

Checks if a type is derived from another by any combination of restriction, list ir union.

private boolean

Returns:

boolean True if the type is derived by extension for the reference type
isDerivedByExtension
(String
The namspace of the ancestor type declaration
ancestorNS
,
String
The name of the ancestor type declaration
ancestorName
,
int
A short indication the method of derivation
derivationMethod
,
XSTypeDefinition
The reference type definition
type
)

Checks if a type is derived from another by extension.

private boolean

Returns:

boolean True if the type is derived by restriciton for the reference type
isDerivedByRestriction
(String
The namspace of the ancestor type declaration
ancestorNS
,
String
The name of the ancestor type declaration
ancestorName
,
int
A short indication the method of derivation *
derivationMethod
,
XSTypeDefinition
The reference type definition
type
)

Checks if a type is derived from another by restriction.

public boolean
isDerivedFrom(String
the namespace of the other type definition.
typeNamespaceArg
,
String
the name of the other type definition.
typeNameArg
,
int
the type of derivation and conditions applied between two types, as described in the list of constants provided in this interface.
derivationMethod
)

Implements org.w3c.dom.TypeInfo.isDerivedFrom.

This method returns if there is a derivation between the reference type definition, i.e. the TypeInfo on which the method is being called, and the other type definition, i.e. the one passed as parameters.
public boolean

Returns:

boolean True if the ancestor type is derived from the reference type by the specifiied derivation method.
isDOMDerivedFrom
(String
The namspace of the ancestor type declaration
ancestorNS
,
String
The name of the ancestor type declaration
ancestorName
,
int
The derivation method
derivationMethod
)

Checks if a type is derived from another given the the name, namespace and derivation method.

public boolean

Returns:

True if derivation is in the final set, otherwise false.
isFinal
(short
Extension, restriction, list, union constants (defined in XSConstants).
derivation
)

Implements org.apache.xerces.xs.XSTypeDefinition.isFinal.

{final} For complex type definition it is a subset of {extension, restriction}.
public boolean

Returns:

True if prohibited is a prohibited substitution, otherwise false.
isProhibitedSubstitution
(short
extention or restriction constants (defined in XSConstants).
prohibited
)

Implements org.apache.xerces.xs.XSComplexTypeDefinition.isProhibitedSubstitution.

{prohibited substitutions} A subset of {extension, restriction}.
public void
public void
public void
public void
public void
pack-priv void
public void
setValues(String name, String targetNamespace, XSTypeDefinition baseType, short derivedBy, short schemaFinal, short block, short contentType, boolean isAbstract, XSAttributeGroupDecl attrGrp, XSSimpleType simpleType, XSParticleDecl particle, XSObjectListImpl annotations)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

CT_HAS_TYPE_IDback to summary
private static final short CT_HAS_TYPE_ID
CT_IS_ABSTRACTback to summary
private static final short CT_IS_ABSTRACT
CT_IS_ANONYMOUSback to summary
private static final short CT_IS_ANONYMOUS
DERIVATION_ANYback to summary
pack-priv static final int DERIVATION_ANY
DERIVATION_EXTENSIONback to summary
pack-priv static final int DERIVATION_EXTENSION

Hides org.w3c.dom.TypeInfo.DERIVATION_EXTENSION.

DERIVATION_LISTback to summary
pack-priv static final int DERIVATION_LIST

Hides org.w3c.dom.TypeInfo.DERIVATION_LIST.

DERIVATION_RESTRICTIONback to summary
pack-priv static final int DERIVATION_RESTRICTION

Hides org.w3c.dom.TypeInfo.DERIVATION_RESTRICTION.

DERIVATION_UNIONback to summary
pack-priv static final int DERIVATION_UNION

Hides org.w3c.dom.TypeInfo.DERIVATION_UNION.

fAnnotationsback to summary
pack-priv XSObjectListImpl fAnnotations
fAttrGrpback to summary
pack-priv XSAttributeGroupDecl fAttrGrp
fBaseTypeback to summary
pack-priv XSTypeDefinition fBaseType
fBlockback to summary
pack-priv short fBlock
fCMValidatorback to summary
pack-priv XSCMValidator fCMValidator
fContentTypeback to summary
pack-priv short fContentType
fDerivedByback to summary
pack-priv short fDerivedBy
fFinalback to summary
pack-priv short fFinal
fMiscFlagsback to summary
pack-priv short fMiscFlags
fNameback to summary
pack-priv String fName
fNamespaceItemback to summary
private XSNamespaceItem fNamespaceItem
fParticleback to summary
pack-priv XSParticleDecl fParticle
fTargetNamespaceback to summary
pack-priv String fTargetNamespace
fUPACMValidatorback to summary
pack-priv XSCMValidator fUPACMValidator
fXSSimpleTypeback to summary
pack-priv XSSimpleType fXSSimpleType

Constructor Detail

XSComplexTypeDeclback to summary
public XSComplexTypeDecl()

Method Detail

appendTypeInfoback to summary
pack-priv void appendTypeInfo(StringBuffer str)
containsTypeIDback to summary
public boolean containsTypeID()
derivedFromback to summary
public boolean derivedFrom(String ancestorNS, String ancestorName, short derivationMethod)

Implements org.apache.xerces.xs.XSTypeDefinition.derivedFrom.

Doc from org.apache.xerces.xs.XSTypeDefinition.derivedFrom.

Convenience method which checks if this type is derived from the given ancestor type.

Parameters
ancestorNS:String

An ancestor type namespace.

ancestorName:String

An ancestor type name.

derivationMethod:short

A bit combination representing a subset of { DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST }.

Returns:boolean

True if this type is derived from ancestorType using only derivation methods from the derivationMethod .

derivedFromTypeback to summary
public boolean derivedFromType(XSTypeDefinition ancestor, short derivationMethod)

Implements org.apache.xerces.xs.XSTypeDefinition.derivedFromType.

Doc from org.apache.xerces.xs.XSTypeDefinition.derivedFromType.

Convenience method which checks if this type is derived from the given ancestorType.

Parameters
ancestor:XSTypeDefinition

An ancestor type definition.

derivationMethod:short

A bit combination representing a subset of { DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST }.

Returns:boolean

True if this type is derived from ancestorType using only derivation methods from the derivationMethod .

getAbstractback to summary
public boolean getAbstract()

Implements org.apache.xerces.xs.XSComplexTypeDefinition.getAbstract.

{abstract} A boolean. Complex types for which {abstract} is true must not be used as the {type definition} for the validation of element information items.

getAnnotationsback to summary
public XSObjectList getAnnotations()

Implements org.apache.xerces.xs.XSComplexTypeDefinition.getAnnotations.

Optional. Annotation.

getAnonymousback to summary
public boolean getAnonymous()

Implements org.apache.xerces.xs.XSTypeDefinition.getAnonymous.

A boolean that specifies if the type definition is anonymous. Convenience attribute. This is a field is not part of XML Schema component model.

getAttrGrpback to summary
public XSAttributeGroupDecl getAttrGrp()
getAttributeUseback to summary
public XSAttributeUse getAttributeUse(String namespace, String name)
getAttributeUsesback to summary
public XSObjectList getAttributeUses()

Implements org.apache.xerces.xs.XSComplexTypeDefinition.getAttributeUses.

{attribute uses} A set of attribute uses.

getAttributeWildcardback to summary
public XSWildcard getAttributeWildcard()

Implements org.apache.xerces.xs.XSComplexTypeDefinition.getAttributeWildcard.

{attribute wildcard} Optional. A wildcard.

getBaseTypeback to summary
public XSTypeDefinition getBaseType()

Implements org.apache.xerces.xs.XSTypeDefinition.getBaseType.

{base type definition} Either a simple type definition or a complex type definition.

getContentModelback to summary
public XSCMValidator getContentModel(CMBuilder cmBuilder)
getContentModelback to summary
public synchronized XSCMValidator getContentModel(CMBuilder cmBuilder, boolean forUPA)
getContentTypeback to summary
public short getContentType()

Implements org.apache.xerces.xs.XSComplexTypeDefinition.getContentType.

{content type} One of empty, a simple type definition (see simpleType, or mixed, element-only (see cmParticle).

getDerivationMethodback to summary
public short getDerivationMethod()

Implements org.apache.xerces.xs.XSComplexTypeDefinition.getDerivationMethod.

{derivation method} Either extension or restriction. The valid constant value for this XSConstants EXTENTION, RESTRICTION.

getFinalback to summary
public short getFinal()

Implements org.apache.xerces.xs.XSTypeDefinition.getFinal.

{final} For complex type definition it is a subset of {extension, restriction}.

Returns:short

A bit flag that represents: {extension, restriction) or none for complexTypes; {extension, list, restriction, union} or none for simpleTypes;

getFinalSetback to summary
public short getFinalSet()
getNameback to summary
public String getName()

Implements org.apache.xerces.xs.XSObject.getName.

The name of this XSObject depending on the XSObject type.

getNamespaceback to summary
public String getNamespace()

Implements org.apache.xerces.xs.XSObject.getNamespace.

The namespace URI of this node, or null if it is unspecified. defines how a namespace URI is attached to schema components.

getNamespaceItemback to summary
public XSNamespaceItem getNamespaceItem()

Implements org.apache.xerces.xs.XSObject.getNamespaceItem.

Doc from org.apache.xerces.xs.XSObject.getNamespaceItem.

A namespace schema information item corresponding to the target namespace of the component, if it is globally declared; or null otherwise.

See Also
org.apache.xerces.xs.XSObject#getNamespaceItem()
getParticleback to summary
public XSParticle getParticle()

Implements org.apache.xerces.xs.XSComplexTypeDefinition.getParticle.

A particle for mixed or element-only content model, otherwise null

getProhibitedSubstitutionsback to summary
public short getProhibitedSubstitutions()

Implements org.apache.xerces.xs.XSComplexTypeDefinition.getProhibitedSubstitutions.

{prohibited substitutions}

Returns:short

A bit flag corresponding to prohibited substitutions

getSimpleTypeback to summary
public XSSimpleTypeDefinition getSimpleType()

Implements org.apache.xerces.xs.XSComplexTypeDefinition.getSimpleType.

A simple type definition corresponding to simple content model, otherwise null

getTargetNamespaceback to summary
public String getTargetNamespace()
getTypeback to summary
public short getType()

Implements org.apache.xerces.xs.XSObject.getType.

Get the type of the object, i.e ELEMENT_DECLARATION.

getTypeCategoryback to summary
public short getTypeCategory()

Implements org.apache.xerces.xs.XSTypeDefinition.getTypeCategory.

Doc from org.apache.xerces.xs.XSTypeDefinition.getTypeCategory.

Return whether this type definition is a simple type or complex type.

getTypeNameback to summary
public String getTypeName()

Implements org.w3c.dom.TypeInfo.getTypeName.

Doc from org.w3c.dom.TypeInfo.getTypeName.

The name of a type declared for the associated element or attribute, or null if unknown.

getTypeNamespaceback to summary
public String getTypeNamespace()

Implements org.w3c.dom.TypeInfo.getTypeNamespace.

Doc from org.w3c.dom.TypeInfo.getTypeNamespace.

The namespace of the type declared for the associated element or attribute or null if the element does not have declaration or if no namespace information is available.

isDerivedByAnyback to summary
private boolean isDerivedByAny(String ancestorNS, String ancestorName, int derivationMethod, XSTypeDefinition type)

Checks if a type is derived from another by any combination of restriction, list ir union. See: http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom

Parameters
ancestorNS:String

The namspace of the ancestor type declaration

ancestorName:String

The name of the ancestor type declaration

derivationMethod:int

A short indication the method of derivation

type:XSTypeDefinition

The reference type definition

Returns:boolean

boolean True if the type is derived by any method for the reference type

isDerivedByExtensionback to summary
private boolean isDerivedByExtension(String ancestorNS, String ancestorName, int derivationMethod, XSTypeDefinition type)

Checks if a type is derived from another by extension. See: http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom

Parameters
ancestorNS:String

The namspace of the ancestor type declaration

ancestorName:String

The name of the ancestor type declaration

derivationMethod:int

A short indication the method of derivation

type:XSTypeDefinition

The reference type definition

Returns:boolean

boolean True if the type is derived by extension for the reference type

isDerivedByRestrictionback to summary
private boolean isDerivedByRestriction(String ancestorNS, String ancestorName, int derivationMethod, XSTypeDefinition type)

Checks if a type is derived from another by restriction. See: http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom

Parameters
ancestorNS:String

The namspace of the ancestor type declaration

ancestorName:String

The name of the ancestor type declaration

derivationMethod:int

A short indication the method of derivation *

type:XSTypeDefinition

The reference type definition

Returns:boolean

boolean True if the type is derived by restriciton for the reference type

isDerivedFromback to summary
public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod)

Implements org.w3c.dom.TypeInfo.isDerivedFrom.

Doc from org.w3c.dom.TypeInfo.isDerivedFrom.

This method returns if there is a derivation between the reference type definition, i.e. the TypeInfo on which the method is being called, and the other type definition, i.e. the one passed as parameters.

Parameters
typeNamespaceArg:String

the namespace of the other type definition.

typeNameArg:String

the name of the other type definition.

derivationMethod:int

the type of derivation and conditions applied between two types, as described in the list of constants provided in this interface.

Returns:boolean

If the document's schema is a DTD or no schema is associated with the document, this method will always return false . If the document's schema is an XML Schema, the method will return true if the reference type definition is derived from the other type definition according to the derivation parameter. If the value of the parameter is 0 (no bit is set to 1 for the derivationMethod parameter), the method will return true if the other type definition can be reached by recursing any combination of {base type definition}, {item type definition}, or {member type definitions} from the reference type definition.

isDOMDerivedFromback to summary
public boolean isDOMDerivedFrom(String ancestorNS, String ancestorName, int derivationMethod)

Checks if a type is derived from another given the the name, namespace and derivation method. See: http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom

Parameters
ancestorNS:String

The namspace of the ancestor type declaration

ancestorName:String

The name of the ancestor type declaration

derivationMethod:int

The derivation method

Returns:boolean

boolean True if the ancestor type is derived from the reference type by the specifiied derivation method.

isFinalback to summary
public boolean isFinal(short derivation)

Implements org.apache.xerces.xs.XSTypeDefinition.isFinal.

{final} For complex type definition it is a subset of {extension, restriction}. For simple type definition it is a subset of {extension, list, restriction, union}.

Parameters
derivation:short

Extension, restriction, list, union constants (defined in XSConstants).

Returns:boolean

True if derivation is in the final set, otherwise false.

isProhibitedSubstitutionback to summary
public boolean isProhibitedSubstitution(short prohibited)

Implements org.apache.xerces.xs.XSComplexTypeDefinition.isProhibitedSubstitution.

{prohibited substitutions} A subset of {extension, restriction}.

Parameters
prohibited:short

extention or restriction constants (defined in XSConstants).

Returns:boolean

True if prohibited is a prohibited substitution, otherwise false.

resetback to summary
public void reset()
setContainsTypeIDback to summary
public void setContainsTypeID()
setIsAbstractTypeback to summary
public void setIsAbstractType()
setIsAnonymousback to summary
public void setIsAnonymous()
setNameback to summary
public void setName(String name)
setNamespaceItemback to summary
pack-priv void setNamespaceItem(XSNamespaceItem namespaceItem)
setValuesback to summary
public void setValues(String name, String targetNamespace, XSTypeDefinition baseType, short derivedBy, short schemaFinal, short block, short contentType, boolean isAbstract, XSAttributeGroupDecl attrGrp, XSSimpleType simpleType, XSParticleDecl particle, XSObjectListImpl annotations)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.