org.exolab.castor.xml.schema

Class Group

public class Group extends Particle implements ContentModelGroup, Referable

An XML Schema Group

Version: $Revision: 6230 $ $Date: 2006-04-14 04:14:43 -0600 (Fri, 14 Apr 2006) $

Author: Keith Visco

Constructor Summary
Group()
Creates a new Group, with no name
Group(String name)
Creates a new Group with the given name
Method Summary
voidaddElementDecl(ElementDecl elementDecl)
Adds the given ElementDecl to this ContentModelGroup
voidaddGroup(Group group)
Adds the given Group to this ContentModelGroup
voidaddGroup(ModelGroup group)
Adds the given ModelGroup Definition to this Group
voidaddWildcard(Wildcard wildcard)
Adds a wildcard to this Group model
Enumerationenumerate()
Returns an enumeration of all the Particles of this ContentModelGroup
ContentModelGroupgetContentModelGroup()
Returns the ContentModelGroup for this group Only used for a element
ElementDeclgetElementDecl(String name)
Returns the element declaration with the given name, or null if no element declaration with that name exists in this ContentModelGroup.
StringgetId()
Returns the ID for this Group
StringgetName()
Returns the name of this Group, or null if no name was defined.
OrdergetOrder()
Returns the compositor for this Group
StructuregetParent()
Returns the parent of this Group, this value may be null if no parent has been set.
ParticlegetParticle(int index)
Returns the Particle at the specified index
intgetParticleCount()
Returns the number of particles contained within this ContentModelGroup
StringgetReferenceId()
Returns the Id used to Refer to this Object
shortgetStructureType()
Returns the type of this Schema Structure
booleanhasAny()
A helper method that returns true if this group contains an {@literal } element.
booleanisEmptiable()
booleanisModelGroupDefinition()
Tells if the group is a model group definition
booleanremoveElementDecl(ElementDecl element)
Removes the given ElementDecl from this ContentModelGroup.
booleanremoveGroup(Group group)
Removes the given Group from this Group.
booleanremoveGroup(ModelGroup group)
Removes the given ModelGroup Definition from this Group.
booleanremoveWildcard(Wildcard wildcard)
Removes the given Wildcard from this Group.
voidsetId(String id)
Sets the ID for this Group
voidsetIsModelGroupDefinition(boolean isModelGroupDefinition)
Sets if the group is a model group definition
voidsetName(String name)
Sets the name of this Group
voidsetOrder(Order order)
Sets the Order option for this Group
protected voidsetParent(Structure parent)
Sets the parent for this Group
voidvalidate()
Checks the validity of this Group defintion.

Constructor Detail

Group

public Group()
Creates a new Group, with no name

Group

public Group(String name)
Creates a new Group with the given name

Parameters: name of the Group

Method Detail

addElementDecl

public void addElementDecl(ElementDecl elementDecl)
Adds the given ElementDecl to this ContentModelGroup

Parameters: elementDecl the ElementDecl to add

Throws: SchemaException when an ElementDecl already exists with the same name as the given ElementDecl

addGroup

public void addGroup(Group group)
Adds the given Group to this ContentModelGroup

Parameters: group the Group to add

Throws: SchemaException when a group with the same name as the specified group already exists in the current scope

addGroup

public void addGroup(ModelGroup group)
Adds the given ModelGroup Definition to this Group

Parameters: group the ModelGroup to add

Throws: SchemaException when a group with the same name as the specified group already exists in the current scope

addWildcard

public void addWildcard(Wildcard wildcard)
Adds a wildcard to this Group model

Parameters: wildcard the Wildcard to add

Throws: SchemaException thrown when the wildcard is an {@literal } element

enumerate

public Enumeration enumerate()
Returns an enumeration of all the Particles of this ContentModelGroup

Returns: an enumeration of the Particles contained within this ContentModelGroup

getContentModelGroup

public ContentModelGroup getContentModelGroup()
Returns the ContentModelGroup for this group Only used for a element

Returns: the ContentModelGroup for this group

getElementDecl

public 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.

Parameters: name the name of the element.

Returns: the ElementDecl with the given name, or null if no ElementDecl exists in this ContentModelGroup.

getId

public String getId()
Returns the ID for this Group

Returns: the ID for this Group, or null if no ID is present

getName

public String getName()
Returns the name of this Group, or null if no name was defined.

Returns: the name of this Group, or null if no name was defined

getOrder

public Order getOrder()
Returns the compositor for this Group

Returns: the compositor for this Group

getParent

public Structure getParent()
Returns the parent of this Group, this value may be null if no parent has been set.

Returns: the parent Structure of this Group.

getParticle

public Particle getParticle(int index)
Returns the Particle at the specified index

Parameters: index the index of the particle to return

Returns: the CMParticle at the specified index

getParticleCount

public int getParticleCount()
Returns the number of particles contained within this ContentModelGroup

Returns: the number of particles

getReferenceId

public String getReferenceId()
Returns the Id used to Refer to this Object

Returns: the Id used to Refer to this Object

See Also:

getStructureType

public short getStructureType()
Returns the type of this Schema Structure

Returns: the type of this Schema Structure

hasAny

public boolean hasAny()
A helper method that returns true if this group contains an {@literal } element.

Returns: method that returns true if this group contains an {@literal } element.

isEmptiable

public boolean isEmptiable()

Returns: true if this Particle is emptiable

isModelGroupDefinition

public boolean isModelGroupDefinition()

Deprecated: Since Castor 0.9.2, to handle properly the element the class ModelGroup has been created

Tells if the group is a model group definition

Returns: true if the group is a model group definition ( tag), false otherwise {@literal }, , or tags.

removeElementDecl

public boolean removeElementDecl(ElementDecl element)
Removes the given ElementDecl from this ContentModelGroup.

Parameters: element the ElementDecl to remove.

Returns: true if the element has been successfully removed, false otherwise.

removeGroup

public boolean removeGroup(Group group)
Removes the given Group from this Group.

Parameters: group the Group to remove.

Returns: true if the group has been successfully removed, false otherwise.

removeGroup

public boolean removeGroup(ModelGroup group)
Removes the given ModelGroup Definition from this Group.

Parameters: group the ModelGroup Definition to remove.

Returns: true if the group has been successfully removed, false otherwise.

removeWildcard

public boolean removeWildcard(Wildcard wildcard)
Removes the given Wildcard from this Group.

Parameters: wildcard the Wildcard to remove.

Returns: true if the wildcard has been successfully removed, false otherwise.

setId

public void setId(String id)
Sets the ID for this Group

Parameters: id the ID for this Group

setIsModelGroupDefinition

public void setIsModelGroupDefinition(boolean isModelGroupDefinition)

Deprecated: Since Castor 0.9.2, to handle properly the element the class ModelGroup has been created

Sets if the group is a model group definition

setName

public void setName(String name)
Sets the name of this Group

Parameters: name the new name for this Group

setOrder

public void setOrder(Order order)
Sets the Order option for this Group

Parameters: order the type of order that this group is restricted to

setParent

protected void setParent(Structure parent)
Sets the parent for this Group

Parameters: parent the parent Structure for this Group

validate

public void validate()
Checks the validity of this Group defintion.

Throws: ValidationException when this Group definition is invalid.

Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com