public class ComplexType extends XMLType implements ContentModelGroup, Referable
NULL_ARGUMENTANNOTATION, ANYTYPE, APPINFO, ATTRIBUTE, ATTRIBUTE_GROUP, COMPLEX_CONTENT, COMPLEX_TYPE, DOCUMENTATION, ELEMENT, FACET, GROUP, IDENTITY_FIELD, IDENTITY_SELECTOR, KEY, KEYREF, LIST, MODELGROUP, MODELGROUP_REF, REDEFINE, SCHEMA, SIMPLE_CONTENT, SIMPLE_TYPE, UNION, UNIQUE, UNKNOWN, WILDCARD| Constructor and Description |
|---|
ComplexType(Schema schema)
Creates a new Complextype, with no name
|
ComplexType(Schema schema,
java.lang.String name)
Creates a new Complextype with the given name
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttributeDecl(AttributeDecl attrDecl)
Adds the given AttributeDecl to this ComplexType
|
void |
addAttributeGroupReference(AttributeGroupReference attrGroupRef)
Adds the given AttributeGroupReference to this ComplexType
|
void |
addElementDecl(ElementDecl elementDecl)
Adds the given ElementDecl to this ContentModelGroup
|
void |
addGroup(Group group)
Adds the given Group to this ContentModelGroup
|
void |
addGroup(ModelGroup group)
Adds the given ModelGroup Definition to this ContentModelGroup
|
void |
addWildcard(Wildcard wildcard)
Adds the given wildcard to this ContentModelGroup
|
AttributeDecl |
createAttributeDecl(java.lang.String name)
Creates an AttributeDecl with the given name.
|
java.util.Enumeration |
enumerate()
Returns an enumeration of all the Particles of this
ContentModelGroup
|
Wildcard |
getAnyAttribute()
Returns the wilcard used in this complexType (can be null)
|
AttributeDecl |
getAttributeDecl(java.lang.String name)
Returns the AttributeDecl associated with the given name
|
java.util.Enumeration |
getAttributeDecls()
Returns an Enumeration of *all* the AttributeDecl objects
declared within this ComplexType.
|
java.util.Enumeration |
getAttributeGroupReferences()
Returns an Enumeration of all the AttributeGroup that are referenced
within this ComplexType.
|
XMLType |
getBaseType()
Returns the base type that this type inherits from.
|
BlockList |
getBlock()
Returns the value of the 'block' attribute for this element
|
ContentType |
getContentType()
Returns the content type of this ComplexType.
|
ElementDecl |
getElementDecl(java.lang.String name)
Returns the element declaration with the given name, or null if no
element declaration with that name exists in this ContentModelGroup.
|
FinalList |
getFinal()
Returns the list of values for the final property for this
ComplexType, or null if no final values have been set.
|
java.util.Enumeration |
getLocalAttributeDecls()
Returns an Enumeration of *all* locally defined AttributeDecl
declared within this ComplexType.
|
int |
getMaxOccurs()
Returns the maximum number of occurances that this ContentModelGroup
may appear
|
int |
getMinOccurs()
Returns the minimum number of occurances that this ContentModelGroup
must appear
|
Structure |
getParent()
Returns the parent of this ComplexType, this value may be null if
no parent has been set.
|
Particle |
getParticle(int index)
Returns the Particle at the specified index
|
int |
getParticleCount()
Returns the number of particles contained within
this ContentModelGroup
|
java.lang.String |
getReferenceId()
Returns the Id used to Refer to this Object
|
short |
getStructureType()
Returns the type of this Schema Structure
|
boolean |
hasAny()
A helper method that returns true if this complexType
contains an <any> element.
|
boolean |
isAbstract()
Returns true if this ComplexType has been marked as Abstract.
|
boolean |
isComplexContent()
Returns true if this complexType is a 'complexContent'
|
boolean |
isEmptiable() |
boolean |
isRedefined()
Returns true if this complexType is a redefinition.
|
boolean |
isRestricted()
Returns true if this complexType is a restriction
|
boolean |
isSimpleContent()
Returns true if this complexType is a 'simpleContent'
|
boolean |
isTopLevel()
Returns true if this is a top level Complextype
|
void |
removeAttributeDecl(AttributeDecl attrDecl)
Removes the given AttributeDecl from this ComplexType
|
void |
removeAttributeGroupReference(AttributeGroupReference attrGroupRef)
Removes the given AttributeGroupReference from this ComplexType
|
boolean |
removeElementDecl(ElementDecl element)
Removes the given ElementDecl from this ContentModelGroup.
|
boolean |
removeGroup(Group group)
Removes the given Group from this ContentModelGroup.
|
boolean |
removeGroup(ModelGroup group)
Removes the given ModelGroup Definition from this ContentModelGroup.
|
boolean |
removeWildcard(Wildcard wildcard)
Removes the given Wildcard from this Group.
|
void |
setAbstract(boolean isAbstract)
Sets whether or not this ComplexType should be abstract.
|
void |
setAnyAttribute(Wildcard wildcard)
Sets the wildcard (anyAttribute) of the complexType
|
void |
setBase(java.lang.String base)
Sets the base type that this type is derived from
|
void |
setBaseType(XMLType baseType)
Sets the base type for this ComplexType
|
void |
setBlock(BlockList block)
Sets the value of the 'block' attribute for this ComplexType.
|
void |
setBlock(java.lang.String block)
Sets the value of the 'block' attribute for this ComplexType.
|
void |
setComplexContent(boolean complexContent)
Sets whether or not this complexType is a 'complexContent'
|
void |
setContentType(ContentType contentType)
Sets the content type of this complexType.
|
void |
setFinal(FinalList finalList)
Sets the value of the 'final' attribute for this ComplexType
definition.
|
void |
setFinal(java.lang.String finalValue)
Sets the value of the 'final' attribute for this ComplexType
definition.
|
protected void |
setParent(Structure parent)
Sets the parent for this ComplexType
|
void |
setRedefined()
Sets this Group has redefined.
|
void |
setRestriction(boolean restricted)
Sets whether or not this complexType is a restriction
|
void |
setSimpleContent(boolean simpleContent)
Sets whether or not this complexType is a 'simpleContent'
|
void |
useResolver(Resolver resolver) |
void |
validate()
Checks the validity of this ComplexType defintion.
|
getDerivationMethod, getId, getName, getSchema, getType, isAnyType, isComplexType, isSimpleType, setDerivationMethod, setId, setName, setSchemaaddAnnotation, getAnnotations, removeAnnotationpublic ComplexType(Schema schema)
schema - the owning Schema documentpublic ComplexType(Schema schema, java.lang.String name)
schema - the owning Schemaname - of the Complextypepublic void addAttributeDecl(AttributeDecl attrDecl) throws SchemaException
attrDecl - the AttributeDecl to add to this ComplexTypeSchemaException - when an AttributeDecl already
exists with the same name as the given AttributeDeclpublic void removeAttributeDecl(AttributeDecl attrDecl)
attrDecl - the AttributeDecl to remove.public void addAttributeGroupReference(AttributeGroupReference attrGroupRef)
attrGroupRef - the AttributeGroupReference to add to this
ComplexTypepublic void removeAttributeGroupReference(AttributeGroupReference attrGroupRef)
attrGroupRef - the AttributeGroupReference to remove.public AttributeDecl createAttributeDecl(java.lang.String name)
name - the name of the attributepublic Wildcard getAnyAttribute()
public AttributeDecl getAttributeDecl(java.lang.String name)
public java.util.Enumeration getAttributeDecls()
getLocalAttributeDecls.public java.util.Enumeration getLocalAttributeDecls()
public java.util.Enumeration getAttributeGroupReferences()
public XMLType getBaseType()
getBaseType in class XMLTypepublic BlockList getBlock()
public ContentType getContentType()
public FinalList getFinal()
public Structure getParent()
public java.lang.String getReferenceId()
getReferenceId in interface ReferableReferablepublic boolean hasAny()
public boolean isAbstract()
public boolean isRedefined()
public boolean isTopLevel()
public boolean isComplexContent()
public boolean isSimpleContent()
public boolean isRestricted()
public void setAbstract(boolean isAbstract)
isAbstract - a boolean that when true makes this ComplexType
abstract.public void setAnyAttribute(Wildcard wildcard) throws SchemaException
SchemaException - thrown when a wildcard as already be set
or when the wildCard is not an <anyAttribute>.public boolean removeWildcard(Wildcard wildcard)
removeWildcard in interface ContentModelGroupwildcard - the Wildcard to remove.public void addWildcard(Wildcard wildcard) throws SchemaException
ContentModelGroupaddWildcard in interface ContentModelGroupwildcard - the wilcard to addSchemaException - when the wilcard is <anyAttribute> and
not <any>public void setBase(java.lang.String base)
base - the type that this type is derived frompublic void setBaseType(XMLType baseType)
setBaseType in class XMLTypebaseType - the base type which this ComplexType
extends or restrictspublic void setBlock(BlockList block)
block - the value of the block attribute for this
ComplexType definition.public void setBlock(java.lang.String block)
block - the value of the block attribute for this
ComplexType definition.public void setComplexContent(boolean complexContent)
complexContent - true if this complexType is a 'complexContent'public void setContentType(ContentType contentType)
contentType - the ContentType for this complexTypepublic void setFinal(FinalList finalList)
finalList - the value of the final attribute for this
ComplexType definition.public void setFinal(java.lang.String finalValue)
finalValue - the value of the final attribute for this
ComplexType definition.public void setRedefined()
public void setSimpleContent(boolean simpleContent)
simpleContent - true if this complexType is a 'simpleContent'public void setRestriction(boolean restricted)
restricted - true if this complexType is a restrictionpublic void useResolver(Resolver resolver)
public void addElementDecl(ElementDecl elementDecl) throws SchemaException
addElementDecl in interface ContentModelGroupelementDecl - the ElementDecl to addSchemaException - when an ElementDecl already
exists with the same name as the given ElementDeclpublic boolean removeElementDecl(ElementDecl element)
removeElementDecl in interface ContentModelGroupelement - the ElementDecl to remove.public void addGroup(Group group) throws SchemaException
addGroup in interface ContentModelGroupgroup - the Group to addSchemaException - when a group with the same name as the
specified group already exists in the current scopepublic boolean removeGroup(Group group)
removeGroup in interface ContentModelGroupgroup - the Group to remove.public void addGroup(ModelGroup group) throws SchemaException
addGroup in interface ContentModelGroupgroup - the ModelGroup to addSchemaException - when a group with the same name as the
specified group already exists in the current scopepublic boolean removeGroup(ModelGroup group)
removeGroup in interface ContentModelGroupgroup - the ModelGroup Definition to remove.public java.util.Enumeration enumerate()
enumerate in interface ContentModelGrouppublic ElementDecl getElementDecl(java.lang.String name)
getElementDecl in interface ContentModelGroupname - the name of the element.public int getMaxOccurs()
getMaxOccurs in interface ContentModelGrouppublic int getMinOccurs()
getMinOccurs in interface ContentModelGrouppublic Particle getParticle(int index)
getParticle in interface ContentModelGroupindex - the index of the particle to returnpublic int getParticleCount()
getParticleCount in interface ContentModelGrouppublic short getStructureType()
getStructureType in class Structurepublic void validate()
throws ValidationException
validate in class StructureValidationException - when this ComplexType definition
is invalid.protected void setParent(Structure parent)
public boolean isEmptiable()
Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com