|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exolab.castor.xml.schema.Structure
org.exolab.castor.xml.schema.Annotated
org.exolab.castor.xml.schema.XMLType
org.exolab.castor.xml.schema.ComplexType
public class ComplexType
The XML Schema ComplexType class.
| Field Summary |
|---|
| Fields inherited from class org.exolab.castor.xml.schema.XMLType |
|---|
NULL_ARGUMENT |
| Fields inherited from class org.exolab.castor.xml.schema.Structure |
|---|
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 |
| Constructor Summary | |
|---|---|
ComplexType(Schema schema)
Creates a new ComplexType instance with no name. |
|
ComplexType(Schema schema,
String name)
Creates a new ComplexType with the given name. |
|
| Method Summary | |
|---|---|
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(String name)
Creates an AttributeDecl with the given name. |
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(String name)
Returns the AttributeDecl associated with the given name. |
Enumeration |
getAttributeDecls()
Returns an Enumeration of *all* the AttributeDecl objects declared within this ComplexType. |
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(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. |
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. |
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(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(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(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. |
| Methods inherited from class org.exolab.castor.xml.schema.XMLType |
|---|
getBaseTypeName, getDerivationMethod, getId, getName, getSchema, isAnyType, isComplexType, isSimpleType, setDerivationMethod, setId, setName, setSchema |
| Methods inherited from class org.exolab.castor.xml.schema.Annotated |
|---|
addAnnotation, getAnnotations, removeAnnotation |
| Methods inherited from class org.exolab.castor.xml.schema.Structure |
|---|
isValid |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ComplexType(Schema schema)
ComplexType instance with no name.
schema - the owning Schema document
public ComplexType(Schema schema,
String name)
ComplexType with the given name.
schema - The owning Schema instancename - Name of the ComplexType| Method Detail |
|---|
public void addAttributeDecl(AttributeDecl attrDecl)
AttributeDecl to this ComplexType.
attrDecl - the AttributeDecl to add to this ComplexTypepublic 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(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 #addAttributeDecl
name - the name of the attribute
public Wildcard getAnyAttribute()
public AttributeDecl getAttributeDecl(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 Enumeration getAttributeDecls()
getLocalAttributeDecls.
public Enumeration getLocalAttributeDecls()
public Enumeration getAttributeGroupReferences()
public XMLType getBaseType()
getBaseType in class XMLTypepublic BlockList getBlock()
public ContentType getContentType()
public FinalList getFinal()
public Structure getParent()
public String getReferenceId()
getReferenceId in interface ReferableReferablepublic boolean hasAny()
public boolean isAbstract()
public boolean isRedefined()
public boolean isTopLevel()
ComplexType.
ComplexTypepublic 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 ContentModelGroupwildcard - the Wildcard to remove.
public void addWildcard(Wildcard wildcard)
throws SchemaException
ContentModelGroupWildcard to this ContentModelGroup.
addWildcard in interface ContentModelGroupwildcard - the Wildcard to add
SchemaException - when the Wildcard is <anyAttribute> and
not <any>public void setBase(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(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(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 ContentModelGroupelementDecl - the ElementDecl to add
SchemaException - 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
ContentModelGroup.
addGroup in interface ContentModelGroupgroup - the Group to add
SchemaException - 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
ContentModelGroup.
addGroup in interface ContentModelGroupgroup - the ModelGroup to add
SchemaException - 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 Enumeration enumerate()
enumerate in interface ContentModelGrouppublic ElementDecl getElementDecl(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 return
public int getParticleCount()
getParticleCount in interface ContentModelGrouppublic short getStructureType()
getStructureType in class Structure
public void validate()
throws ValidationException
validate in class StructureValidationException - when this ComplexType definition is invalid.protected void setParent(Structure parent)
setParent in class XMLTypeparent - the parent Structure for this ComplexTypepublic boolean isEmptiable()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||