Class XSComplexTypeDecl
- java.lang.Object
-
- org.smooks.engine.delivery.sax.ng.org.apache.xerces.impl.xs.XSComplexTypeDecl
-
- All Implemented Interfaces:
XSComplexTypeDefinition,XSObject,XSTypeDefinition,TypeInfo
public class XSComplexTypeDecl extends Object implements XSComplexTypeDefinition, TypeInfo
The XML representation for a complexType schema component is a <complexType> element information item- Version:
- $Id$
- Author:
- Elena Litani, IBM, Sandy Gao, IBM
-
-
Field Summary
-
Fields inherited from interface org.smooks.engine.delivery.sax.ng.org.apache.xerces.xs.XSComplexTypeDefinition
CONTENTTYPE_ELEMENT, CONTENTTYPE_EMPTY, CONTENTTYPE_MIXED, CONTENTTYPE_SIMPLE
-
Fields inherited from interface org.smooks.engine.delivery.sax.ng.org.apache.xerces.xs.XSTypeDefinition
COMPLEX_TYPE, SIMPLE_TYPE
-
-
Constructor Summary
Constructors Constructor Description XSComplexTypeDecl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsTypeID()booleanderivedFrom(String ancestorNS, String ancestorName, short derivationMethod)Convenience method which checks if this type is derived from the given ancestor type.booleanderivedFromType(XSTypeDefinition ancestor, short derivationMethod)Convenience method which checks if this type is derived from the givenancestorType.booleangetAbstract(){abstract} A boolean.XSObjectListgetAnnotations()Optional.booleangetAnonymous()A boolean that specifies if the type definition is anonymous.XSAttributeGroupDeclgetAttrGrp()XSAttributeUsegetAttributeUse(String namespace, String name)XSObjectListgetAttributeUses(){attribute uses} A set of attribute uses.XSWildcardgetAttributeWildcard(){attribute wildcard} Optional.XSTypeDefinitiongetBaseType(){base type definition} Either a simple type definition or a complex type definition.XSCMValidatorgetContentModel(CMBuilder cmBuilder)XSCMValidatorgetContentModel(CMBuilder cmBuilder, boolean forUPA)shortgetContentType(){content type} One of empty, a simple type definition (seesimpleType, or mixed, element-only (seecmParticle).shortgetDerivationMethod(){derivation method} Either extension or restriction.shortgetFinal(){final} For complex type definition it is a subset of {extension, restriction}.shortgetFinalSet()StringgetName()Thenameof thisXSObjectdepending on theXSObjecttype.StringgetNamespace()The namespace URI of this node, ornullif it is unspecified.XSNamespaceItemgetNamespaceItem()A namespace schema information item corresponding to the target namespace of the component, if it is globally declared; ornullotherwise.XSParticlegetParticle()A particle for mixed or element-only content model, otherwisenullshortgetProhibitedSubstitutions(){prohibited substitutions}XSSimpleTypeDefinitiongetSimpleType()A simple type definition corresponding to simple content model, otherwisenullStringgetTargetNamespace()shortgetType()Get the type of the object, i.e ELEMENT_DECLARATION.shortgetTypeCategory()Return whether this type definition is a simple type or complex type.StringgetTypeName()StringgetTypeNamespace()booleanisDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod)booleanisDOMDerivedFrom(String ancestorNS, String ancestorName, int derivationMethod)Checks if a type is derived from another given the the name, namespace and derivation method.booleanisFinal(short derivation){final} For complex type definition it is a subset of {extension, restriction}.booleanisProhibitedSubstitution(short prohibited){prohibited substitutions} A subset of {extension, restriction}.voidreset()voidsetContainsTypeID()voidsetIsAbstractType()voidsetIsAnonymous()voidsetName(String name)voidsetValues(String name, String targetNamespace, XSTypeDefinition baseType, short derivedBy, short schemaFinal, short block, short contentType, boolean isAbstract, XSAttributeGroupDecl attrGrp, XSSimpleType simpleType, XSParticleDecl particle, XSObjectListImpl annotations)StringtoString()
-
-
-
Method Detail
-
setValues
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)
-
setName
public void setName(String name)
-
getTypeCategory
public short getTypeCategory()
Description copied from interface:XSTypeDefinitionReturn whether this type definition is a simple type or complex type.- Specified by:
getTypeCategoryin interfaceXSTypeDefinition
-
getTypeName
public String getTypeName()
- Specified by:
getTypeNamein interfaceTypeInfo
-
getFinalSet
public short getFinalSet()
-
getTargetNamespace
public String getTargetNamespace()
-
containsTypeID
public boolean containsTypeID()
-
setIsAbstractType
public void setIsAbstractType()
-
setContainsTypeID
public void setContainsTypeID()
-
setIsAnonymous
public void setIsAnonymous()
-
getContentModel
public XSCMValidator getContentModel(CMBuilder cmBuilder)
-
getContentModel
public XSCMValidator getContentModel(CMBuilder cmBuilder, boolean forUPA)
-
getAttrGrp
public XSAttributeGroupDecl getAttrGrp()
-
derivedFromType
public boolean derivedFromType(XSTypeDefinition ancestor, short derivationMethod)
Description copied from interface:XSTypeDefinitionConvenience method which checks if this type is derived from the givenancestorType.- Specified by:
derivedFromTypein interfaceXSTypeDefinition- 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
ancestorTypeusing only derivation methods from thederivationMethod.
-
derivedFrom
public boolean derivedFrom(String ancestorNS, String ancestorName, short derivationMethod)
Description copied from interface:XSTypeDefinitionConvenience method which checks if this type is derived from the given ancestor type.- Specified by:
derivedFromin interfaceXSTypeDefinition- 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
ancestorTypeusing only derivation methods from thederivationMethod.
-
isDOMDerivedFrom
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- 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.
-
getName
public String getName()
Thenameof thisXSObjectdepending on theXSObjecttype.
-
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:
getAnonymousin interfaceXSTypeDefinition
-
getNamespace
public String getNamespace()
The namespace URI of this node, ornullif it is unspecified. defines how a namespace URI is attached to schema components.- Specified by:
getNamespacein interfaceXSObject
-
getBaseType
public XSTypeDefinition getBaseType()
{base type definition} Either a simple type definition or a complex type definition.- Specified by:
getBaseTypein interfaceXSTypeDefinition
-
getDerivationMethod
public short getDerivationMethod()
{derivation method} Either extension or restriction. The valid constant value for thisXSConstantsEXTENTION, RESTRICTION.- Specified by:
getDerivationMethodin interfaceXSComplexTypeDefinition
-
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:
isFinalin interfaceXSTypeDefinition- 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:
getFinalin interfaceXSTypeDefinition- 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:
getAbstractin interfaceXSComplexTypeDefinition
-
getAttributeUses
public XSObjectList getAttributeUses()
{attribute uses} A set of attribute uses.- Specified by:
getAttributeUsesin interfaceXSComplexTypeDefinition
-
getAttributeWildcard
public XSWildcard getAttributeWildcard()
{attribute wildcard} Optional. A wildcard.- Specified by:
getAttributeWildcardin interfaceXSComplexTypeDefinition
-
getContentType
public short getContentType()
{content type} One of empty, a simple type definition (seesimpleType, or mixed, element-only (seecmParticle).- Specified by:
getContentTypein interfaceXSComplexTypeDefinition
-
getSimpleType
public XSSimpleTypeDefinition getSimpleType()
A simple type definition corresponding to simple content model, otherwisenull- Specified by:
getSimpleTypein interfaceXSComplexTypeDefinition
-
getParticle
public XSParticle getParticle()
A particle for mixed or element-only content model, otherwisenull- Specified by:
getParticlein interfaceXSComplexTypeDefinition
-
isProhibitedSubstitution
public boolean isProhibitedSubstitution(short prohibited)
{prohibited substitutions} A subset of {extension, restriction}.- Specified by:
isProhibitedSubstitutionin interfaceXSComplexTypeDefinition- 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:
getProhibitedSubstitutionsin interfaceXSComplexTypeDefinition- Returns:
- A bit flag corresponding to prohibited substitutions
-
getAnnotations
public XSObjectList getAnnotations()
Optional. Annotation.- Specified by:
getAnnotationsin interfaceXSComplexTypeDefinition
-
getNamespaceItem
public XSNamespaceItem getNamespaceItem()
Description copied from interface:XSObjectA namespace schema information item corresponding to the target namespace of the component, if it is globally declared; ornullotherwise.- Specified by:
getNamespaceItemin interfaceXSObject- See Also:
XSObject.getNamespaceItem()
-
getAttributeUse
public XSAttributeUse getAttributeUse(String namespace, String name)
-
getTypeNamespace
public String getTypeNamespace()
- Specified by:
getTypeNamespacein interfaceTypeInfo
-
isDerivedFrom
public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod)
- Specified by:
isDerivedFromin interfaceTypeInfo
-
-