Package org.apache.xerces.impl.xs
Class XSComplexTypeDecl
java.lang.Object
org.apache.xerces.impl.xs.XSComplexTypeDecl
- All Implemented Interfaces:
org.apache.xerces.xs.XSComplexTypeDefinition
,org.apache.xerces.xs.XSObject
,org.apache.xerces.xs.XSTypeDefinition
,TypeInfo
public class XSComplexTypeDecl
extends Object
implements org.apache.xerces.xs.XSComplexTypeDefinition, TypeInfo
The XML representation for a complexType
schema component is a <complexType> element information item
INTERNAL:
- Usage of this class is not supported. It may be altered or removed at any time.
- Version:
- $Id: XSComplexTypeDecl.java 965250 2010-07-18 16:04:58Z mrglavas $
- Author:
- Elena Litani, IBM, Sandy Gao, IBM
-
Field Summary
Fields inherited from interface org.apache.xerces.xs.XSComplexTypeDefinition
CONTENTTYPE_ELEMENT, CONTENTTYPE_EMPTY, CONTENTTYPE_MIXED, CONTENTTYPE_SIMPLE
Fields inherited from interface org.apache.xerces.xs.XSTypeDefinition
COMPLEX_TYPE, SIMPLE_TYPE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
derivedFrom
(String ancestorNS, String ancestorName, short derivationMethod) Convenience method which checks if this type is derived from the given ancestor type.boolean
derivedFromType
(org.apache.xerces.xs.XSTypeDefinition ancestor, short derivationMethod) Convenience method which checks if this type is derived from the givenancestorType
.boolean
{abstract} A boolean.org.apache.xerces.xs.XSObjectList
Optional.boolean
A boolean that specifies if the type definition is anonymous.org.apache.xerces.xs.XSAttributeUse
getAttributeUse
(String namespace, String name) org.apache.xerces.xs.XSObjectList
{attribute uses} A set of attribute uses.org.apache.xerces.xs.XSWildcard
{attribute wildcard} Optional.org.apache.xerces.xs.XSTypeDefinition
{base type definition} Either a simple type definition or a complex type definition.getContentModel
(CMBuilder cmBuilder) getContentModel
(CMBuilder cmBuilder, boolean forUPA) short
{content type} One of empty, a simple type definition (seesimpleType
, or mixed, element-only (seecmParticle
).short
{derivation method} Either extension or restriction.short
getFinal()
{final} For complex type definition it is a subset of {extension, restriction}.short
getName()
Thename
of thisXSObject
depending on theXSObject
type.The namespace URI of this node, ornull
if it is unspecified.org.apache.xerces.xs.XSNamespaceItem
A namespace schema information item corresponding to the target namespace of the component, if it is globally declared; ornull
otherwise.org.apache.xerces.xs.XSParticle
A particle for mixed or element-only content model, otherwisenull
short
{prohibited substitutions}org.apache.xerces.xs.XSSimpleTypeDefinition
A simple type definition corresponding to simple content model, otherwisenull
short
getType()
Get the type of the object, i.e ELEMENT_DECLARATION.short
Return whether this type definition is a simple type or complex type.boolean
isDerivedFrom
(String typeNamespaceArg, String typeNameArg, int derivationMethod) boolean
isDOMDerivedFrom
(String ancestorNS, String ancestorName, int derivationMethod) Checks if a type is derived from another given the the name, namespace and derivation method.boolean
isFinal
(short derivation) {final} For complex type definition it is a subset of {extension, restriction}.boolean
isProhibitedSubstitution
(short prohibited) {prohibited substitutions} A subset of {extension, restriction}.void
reset()
void
void
void
void
void
setValues
(String name, String targetNamespace, org.apache.xerces.xs.XSTypeDefinition baseType, short derivedBy, short schemaFinal, short block, short contentType, boolean isAbstract, XSAttributeGroupDecl attrGrp, XSSimpleType simpleType, XSParticleDecl particle, XSObjectListImpl annotations) toString()
-
Constructor Details
-
XSComplexTypeDecl
public XSComplexTypeDecl()
-
-
Method Details
-
setValues
public void setValues(String name, String targetNamespace, org.apache.xerces.xs.XSTypeDefinition baseType, short derivedBy, short schemaFinal, short block, short contentType, boolean isAbstract, XSAttributeGroupDecl attrGrp, XSSimpleType simpleType, XSParticleDecl particle, XSObjectListImpl annotations) -
setName
-
getTypeCategory
public short getTypeCategory()Description copied from interface:org.apache.xerces.xs.XSTypeDefinition
Return whether this type definition is a simple type or complex type.- Specified by:
getTypeCategory
in interfaceorg.apache.xerces.xs.XSTypeDefinition
-
getTypeName
- Specified by:
getTypeName
in interfaceTypeInfo
-
getFinalSet
public short getFinalSet() -
getTargetNamespace
-
containsTypeID
public boolean containsTypeID() -
setIsAbstractType
public void setIsAbstractType() -
setContainsTypeID
public void setContainsTypeID() -
setIsAnonymous
public void setIsAnonymous() -
getContentModel
-
getContentModel
-
getAttrGrp
-
toString
-
derivedFromType
public boolean derivedFromType(org.apache.xerces.xs.XSTypeDefinition ancestor, short derivationMethod) Description copied from interface:org.apache.xerces.xs.XSTypeDefinition
Convenience method which checks if this type is derived from the givenancestorType
.- Specified by:
derivedFromType
in interfaceorg.apache.xerces.xs.XSTypeDefinition
- Parameters:
ancestor
- An ancestor type definition.derivationMethod
- A bit combination representing a subset of {DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST
}.- Returns:
- True if this type is derived from
ancestorType
using only derivation methods from thederivationMethod
.
-
derivedFrom
Description copied from interface:org.apache.xerces.xs.XSTypeDefinition
Convenience method which checks if this type is derived from the given ancestor type.- Specified by:
derivedFrom
in interfaceorg.apache.xerces.xs.XSTypeDefinition
- Parameters:
ancestorNS
- An ancestor type namespace.ancestorName
- An ancestor type name.derivationMethod
- A bit combination representing a subset of {DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST
}.- Returns:
- True if this type is derived from
ancestorType
using only derivation methods from thederivationMethod
.
-
isDOMDerivedFrom
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
- The namspace of the ancestor type declarationancestorName
- The name of the ancestor type declarationderivationMethod
- The derivation method- Returns:
- boolean True if the ancestor type is derived from the reference type by the specifiied derivation method.
-
reset
public void reset() -
getType
public short getType()Get the type of the object, i.e ELEMENT_DECLARATION.- Specified by:
getType
in interfaceorg.apache.xerces.xs.XSObject
-
getName
Thename
of thisXSObject
depending on theXSObject
type.- Specified by:
getName
in interfaceorg.apache.xerces.xs.XSObject
-
getAnonymous
public boolean 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.- Specified by:
getAnonymous
in interfaceorg.apache.xerces.xs.XSTypeDefinition
-
getNamespace
The namespace URI of this node, ornull
if it is unspecified. defines how a namespace URI is attached to schema components.- Specified by:
getNamespace
in interfaceorg.apache.xerces.xs.XSObject
-
getBaseType
public org.apache.xerces.xs.XSTypeDefinition getBaseType(){base type definition} Either a simple type definition or a complex type definition.- Specified by:
getBaseType
in interfaceorg.apache.xerces.xs.XSTypeDefinition
-
getDerivationMethod
public short getDerivationMethod(){derivation method} Either extension or restriction. The valid constant value for thisXSConstants
EXTENTION, RESTRICTION.- Specified by:
getDerivationMethod
in interfaceorg.apache.xerces.xs.XSComplexTypeDefinition
-
isFinal
public boolean isFinal(short derivation) {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}.- Specified by:
isFinal
in interfaceorg.apache.xerces.xs.XSTypeDefinition
- Parameters:
derivation
- Extension, restriction, list, union constants (defined inXSConstants
).- Returns:
- True if derivation is in the final set, otherwise false.
-
getFinal
public short getFinal(){final} For complex type definition it is a subset of {extension, restriction}.- Specified by:
getFinal
in interfaceorg.apache.xerces.xs.XSTypeDefinition
- Returns:
- A bit flag that represents: {extension, restriction) or none for complexTypes; {extension, list, restriction, union} or none for simpleTypes;
-
getAbstract
public boolean 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.- Specified by:
getAbstract
in interfaceorg.apache.xerces.xs.XSComplexTypeDefinition
-
getAttributeUses
public org.apache.xerces.xs.XSObjectList getAttributeUses(){attribute uses} A set of attribute uses.- Specified by:
getAttributeUses
in interfaceorg.apache.xerces.xs.XSComplexTypeDefinition
-
getAttributeWildcard
public org.apache.xerces.xs.XSWildcard getAttributeWildcard(){attribute wildcard} Optional. A wildcard.- Specified by:
getAttributeWildcard
in interfaceorg.apache.xerces.xs.XSComplexTypeDefinition
-
getContentType
public short getContentType(){content type} One of empty, a simple type definition (seesimpleType
, or mixed, element-only (seecmParticle
).- Specified by:
getContentType
in interfaceorg.apache.xerces.xs.XSComplexTypeDefinition
-
getSimpleType
public org.apache.xerces.xs.XSSimpleTypeDefinition getSimpleType()A simple type definition corresponding to simple content model, otherwisenull
- Specified by:
getSimpleType
in interfaceorg.apache.xerces.xs.XSComplexTypeDefinition
-
getParticle
public org.apache.xerces.xs.XSParticle getParticle()A particle for mixed or element-only content model, otherwisenull
- Specified by:
getParticle
in interfaceorg.apache.xerces.xs.XSComplexTypeDefinition
-
isProhibitedSubstitution
public boolean isProhibitedSubstitution(short prohibited) {prohibited substitutions} A subset of {extension, restriction}.- Specified by:
isProhibitedSubstitution
in interfaceorg.apache.xerces.xs.XSComplexTypeDefinition
- Parameters:
prohibited
- extention or restriction constants (defined inXSConstants
).- Returns:
- True if prohibited is a prohibited substitution, otherwise false.
-
getProhibitedSubstitutions
public short getProhibitedSubstitutions(){prohibited substitutions}- Specified by:
getProhibitedSubstitutions
in interfaceorg.apache.xerces.xs.XSComplexTypeDefinition
- Returns:
- A bit flag corresponding to prohibited substitutions
-
getAnnotations
public org.apache.xerces.xs.XSObjectList getAnnotations()Optional. Annotation.- Specified by:
getAnnotations
in interfaceorg.apache.xerces.xs.XSComplexTypeDefinition
-
getNamespaceItem
public org.apache.xerces.xs.XSNamespaceItem getNamespaceItem()Description copied from interface:org.apache.xerces.xs.XSObject
A namespace schema information item corresponding to the target namespace of the component, if it is globally declared; ornull
otherwise.- Specified by:
getNamespaceItem
in interfaceorg.apache.xerces.xs.XSObject
- See Also:
-
getAttributeUse
-
getTypeNamespace
- Specified by:
getTypeNamespace
in interfaceTypeInfo
-
isDerivedFrom
- Specified by:
isDerivedFrom
in interfaceTypeInfo
-