java.io.Serializable
, ContentModelGroup
, Referable
ModelGroup
public class Group extends Particle 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
Constructor | Description |
---|---|
Group() |
Creates a new
Group , with no name. |
Group(java.lang.String name) |
Creates a new
Group with the given name. |
Modifier and Type | Method | Description |
---|---|---|
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 . |
java.util.Enumeration<Annotated> |
enumerate() |
Returns an enumeration of all the
Particle s contained
within this ContentModelGroup . |
ContentModelGroup |
getContentModelGroup() |
Returns the
ContentModelGroup for this group. |
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 . |
java.lang.String |
getId() |
Returns the ID for this
Group . |
java.lang.String |
getName() |
Returns the name of this
Group , or null if no name was defined. |
Order |
getOrder() |
Returns the compositor for this
Group . |
Structure |
getParent() |
Returns the parent of this Group, 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 group
contains an <any> element.
|
boolean |
isEmptiable() |
Indicates whether this
Particle is 'emptiable' |
boolean |
isModelGroupDefinition() |
Deprecated.
Since Castor 0.9.2, to handle properly the
ModelGroup has been created |
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 ContentModelGroup . |
void |
setId(java.lang.String id) |
Sets the ID for this
Group . |
void |
setIsModelGroupDefinition(boolean isModelGroupDefinition) |
Deprecated.
Since Castor 0.9.2, to handle properly the
|
void |
setName(java.lang.String name) |
Sets the name of this
Group . |
void |
setOrder(Order order) |
|
protected void |
setParent(Structure parent) |
Sets the parent for this
Group . |
void |
validate() |
Checks the validity of this
Group defintion. |
addAnnotation, getAnnotations, removeAnnotation
getMaxOccurs, getMinOccurs
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMaxOccurs, getMinOccurs, isMaxOccursSet, isMinOccursSet, setMaxOccurs, setMinOccurs
public Group()
Group
, with no name.public void addWildcard(Wildcard wildcard) throws SchemaException
Wildcard
to this ContentModelGroup
.addWildcard
in interface ContentModelGroup
wildcard
- the Wildcard
to addSchemaException
- when the Wildcard
is <anyAttribute> and
not <any>ContentModelGroup.addWildcard(org.exolab.castor.xml.schema.Wildcard)
public boolean removeWildcard(Wildcard wildcard)
Wildcard
from this ContentModelGroup
.removeWildcard
in interface ContentModelGroup
wildcard
- the Wildcard
to remove.Wildcard
has been successfully removed, false otherwise.ContentModelGroup.removeWildcard(org.exolab.castor.xml.schema.Wildcard)
public ContentModelGroup getContentModelGroup()
ContentModelGroup
for this group.
Only used for a public java.lang.String getId()
Group
.Group
, or null if no ID is presentpublic java.lang.String getName()
Group
, or null if no name was defined.Group
, or null if no name was definedpublic Order getOrder()
Group
.Group
public Structure getParent()
public void setIsModelGroupDefinition(boolean isModelGroupDefinition)
ModelGroup
public boolean isModelGroupDefinition()
ModelGroup
has been createdModelGroup
public java.lang.String getReferenceId()
getReferenceId
in interface Referable
Referable
public void setName(java.lang.String name)
Group
.name
- the new name for this Group
public void setId(java.lang.String id)
Group
.id
- the ID for this Group
public void setOrder(Order order)
public void addElementDecl(ElementDecl elementDecl) throws SchemaException
addElementDecl
in interface ContentModelGroup
elementDecl
- the ElementDecl to addSchemaException
- when an ElementDecl already
exists with the same name as the given ElementDeclContentModelGroup.addElementDecl(org.exolab.castor.xml.schema.ElementDecl)
public boolean removeElementDecl(ElementDecl element)
removeElementDecl
in interface ContentModelGroup
element
- the ElementDecl to remove.ContentModelGroup.removeElementDecl(org.exolab.castor.xml.schema.ElementDecl)
public void addGroup(Group group) throws SchemaException
Group
to this 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 scopeContentModelGroup.addGroup(org.exolab.castor.xml.schema.Group)
public boolean removeGroup(Group group)
Group
from this ContentModelGroup
.removeGroup
in interface ContentModelGroup
group
- the Group to remove.ContentModelGroup.removeGroup(org.exolab.castor.xml.schema.Group)
public void addGroup(ModelGroup group) throws SchemaException
ModelGroup
definition to this 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 scopeContentModelGroup.addGroup(org.exolab.castor.xml.schema.ModelGroup)
public boolean removeGroup(ModelGroup group)
ModelGroup
definition from this ContentModelGroup
.removeGroup
in interface ContentModelGroup
group
- the ModelGroup
definition to remove.ContentModelGroup.removeGroup(org.exolab.castor.xml.schema.ModelGroup)
public java.util.Enumeration<Annotated> enumerate()
Particle
s contained
within this ContentModelGroup
.enumerate
in interface ContentModelGroup
Particle
s contained
within this ContentModelGroup
ContentModelGroup.enumerate()
public ElementDecl getElementDecl(java.lang.String name)
ContentModelGroup
.getElementDecl
in interface ContentModelGroup
name
- the name of the element.ElementDecl
with the given name, or null if no
ElementDecl exists in this ContentModelGroup
.ContentModelGroup.getElementDecl(java.lang.String)
public Particle getParticle(int index)
Particle
at the specified index.getParticle
in interface ContentModelGroup
index
- the index of the Particle
to returnContentModelGroup.getParticle(int)
public int getParticleCount()
ContentModelGroup
.getParticleCount
in interface ContentModelGroup
ContentModelGroup.getParticleCount()
public short getStructureType()
getStructureType
in class Structure
Structure.getStructureType()
public boolean hasAny()
public void validate() throws ValidationException
Group
defintion.validate
in class Structure
ValidationException
- when this Group
definition
is invalid.public boolean isEmptiable()
Particle
is 'emptiable'isEmptiable
in class Particle
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com