java.io.Serializable
, ContentModelGroup
, Referable
public class ComplexType extends XMLType implements ContentModelGroup, Referable
ANNOTATION, 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
NULL_ARGUMENT
Constructor | Description |
---|---|
ComplexType(Schema schema) |
Creates a new
ComplexType instance with no name. |
ComplexType(Schema schema,
java.lang.String name) |
Creates a new
ComplexType with the given name. |
Modifier and Type | Method | 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(java.lang.String block) |
Sets the value of the 'block' attribute for this ComplexType.
|
void |
setBlock(BlockList 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(java.lang.String finalValue) |
Sets the value of the 'final' attribute for this ComplexType definition.
|
void |
setFinal(FinalList finalList) |
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.
|
addAnnotation, getAnnotations, removeAnnotation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBaseTypeName, getDerivationMethod, getId, getName, getSchema, getType, isAnyType, isComplexType, isSimpleType, setDerivationMethod, setId, setName, setSchema
public ComplexType(Schema schema)
ComplexType
instance with no name.schema
- the owning Schema
documentpublic ComplexType(Schema schema, java.lang.String name)
ComplexType
with the given name.schema
- The owning Schema
instancename
- Name of the ComplexType
public void addAttributeDecl(AttributeDecl attrDecl)
AttributeDecl
to this ComplexType
.attrDecl
- the AttributeDecl
to add to this ComplexType
public void removeAttributeDecl(AttributeDecl attrDecl)
AttributeDecl
from this ComplexType
.attrDecl
- the AttributeDecl to remove.public void addAttributeGroupReference(AttributeGroupReference attrGroupRef)
attrGroupRef
- the AttributeGroupReference to add to this ComplexTypepublic void removeAttributeGroupReference(AttributeGroupReference attrGroupRef)
AttributeGroupReference
from this ComplexType
.attrGroupRef
- the AttributeGroupReference
to remove.public AttributeDecl createAttributeDecl(java.lang.String name)
AttributeDecl
with the given name. The attribute declaration
will still need to be added to this ComplexType
, or another archetype in
the same schema, by making a call to #addAttributeDeclname
- the name of the attributepublic Wildcard getAnyAttribute()
public AttributeDecl getAttributeDecl(java.lang.String name)
AttributeDecl
associated with the given name.name
- Name of the associated AttributeDecl
AttributeDecl
associated with the given name, or null if no
AttributeDecl
with the given name was found.public java.util.Enumeration getAttributeDecls()
getLocalAttributeDecls
.public java.util.Enumeration getLocalAttributeDecls()
public java.util.Enumeration getAttributeGroupReferences()
public XMLType getBaseType()
getBaseType
in class XMLType
public BlockList getBlock()
public ContentType getContentType()
public FinalList getFinal()
public Structure getParent()
public java.lang.String getReferenceId()
getReferenceId
in interface Referable
Referable
public boolean hasAny()
public boolean isAbstract()
public boolean isRedefined()
public boolean isTopLevel()
ComplexType
.ComplexType
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
ComplexType
.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 ContentModelGroup
wildcard
- the Wildcard to remove.public void addWildcard(Wildcard wildcard) throws SchemaException
ContentModelGroup
Wildcard
to this ContentModelGroup
.addWildcard
in interface ContentModelGroup
wildcard
- the Wildcard
to addSchemaException
- when the Wildcard
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 XMLType
baseType
- 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
ContentModelGroup
.addElementDecl
in interface ContentModelGroup
elementDecl
- the ElementDecl to addSchemaException
- when an ElementDecl already exists with the same name
as the given ElementDeclpublic boolean removeElementDecl(ElementDecl element)
removeElementDecl
in interface ContentModelGroup
element
- the ElementDecl to remove.public void addGroup(Group group) throws SchemaException
ContentModelGroup
.addGroup
in interface ContentModelGroup
group
- 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 ContentModelGroup
group
- the Group to remove.public void addGroup(ModelGroup group) throws SchemaException
ContentModelGroup
.addGroup
in interface ContentModelGroup
group
- 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 ContentModelGroup
group
- the ModelGroup Definition to remove.public java.util.Enumeration enumerate()
enumerate
in interface ContentModelGroup
public ElementDecl getElementDecl(java.lang.String name)
getElementDecl
in interface ContentModelGroup
name
- the name of the element.public int getMaxOccurs()
getMaxOccurs
in interface ContentModelGroup
public int getMinOccurs()
getMinOccurs
in interface ContentModelGroup
public Particle getParticle(int index)
getParticle
in interface ContentModelGroup
index
- the index of the particle to returnpublic int getParticleCount()
getParticleCount
in interface ContentModelGroup
public short getStructureType()
getStructureType
in class Structure
public void validate() throws ValidationException
validate
in class Structure
ValidationException
- when this ComplexType definition is invalid.protected void setParent(Structure parent)
public boolean isEmptiable()
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com