|
||||||||
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, with no name |
|
ComplexType(Schema schema,
java.lang.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(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 |
boolean |
isAbstract()
Returns true if this ComplexType has been marked as Abstract. |
boolean |
isComplexContent()
Returns true if this complexType is a 'complexContent' |
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. |
Methods inherited from class org.exolab.castor.xml.schema.XMLType |
---|
getDerivationMethod, getId, getName, getSchema, getType, 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)
schema
- the owning Schema documentpublic ComplexType(Schema schema, java.lang.String name)
schema
- the owning Schemaname
- of the ComplextypeMethod Detail |
---|
public void addAttributeDecl(AttributeDecl attrDecl) throws SchemaException
attrDecl
- the AttributeDecl to add to this ComplexType
SchemaException
- 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 attribute
public 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 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()
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 public boolean removeWildcard(Wildcard wildcard)
removeWildcard
in interface ContentModelGroup
wilcard
- the Wildcard to remove.
public void addWildcard(Wildcard wildcard) throws SchemaException
ContentModelGroup
addWildcard
in interface ContentModelGroup
wildcard
- the wilcard to add
SchemaException
- when the wilcard is 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)
complexContent
- true if this complexType is a 'simpleContent'public void setRestriction(boolean restricted)
complexContent
- true if this complexType is a restrictionpublic void useResolver(Resolver resolver)
public void addElementDecl(ElementDecl elementDecl) throws SchemaException
addElementDecl
in interface ContentModelGroup
elementDecl
- 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 ContentModelGroup
elementDecl
- the ElementDecl to remove.
public void addGroup(Group group) throws SchemaException
addGroup
in interface ContentModelGroup
group
- 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 ContentModelGroup
group
- the Group to remove.
public void addGroup(ModelGroup group) throws SchemaException
addGroup
in interface ContentModelGroup
group
- 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 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)
setParent
in class XMLType
parent
- the parent Structure for this ComplexType
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |