org.exolab.castor.xml.schema
Class Group

java.lang.Object
  extended by org.exolab.castor.xml.schema.Structure
      extended by org.exolab.castor.xml.schema.Annotated
          extended by org.exolab.castor.xml.schema.Particle
              extended by org.exolab.castor.xml.schema.Group
All Implemented Interfaces:
java.io.Serializable, ContentModelGroup, Referable
Direct Known Subclasses:
ModelGroup

public class Group
extends Particle
implements ContentModelGroup, Referable

An XML Schema Group

Version:
$Revision: 1.3 $ $Date: 2004/10/01 13:25:21 $
Author:
Keith Visco
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.exolab.castor.xml.schema.Particle
UNBOUNDED
 
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
Group()
          Creates a new Group, with no name
Group(java.lang.String name)
          Creates a new Group with the given name
 
Method Summary
 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 Group
 void addWildcard(Wildcard wildcard)
          Adds a wildcard to this Group model
 java.util.Enumeration enumerate()
          Returns an enumeration of all the Particles of this ContentModelGroup
 ContentModelGroup getContentModelGroup()
          Returns the ContentModelGroup for this group Only used for a element
 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 element.
 boolean isModelGroupDefinition()
          Deprecated. Since Castor 0.9.2, to handle properly the element the class 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 Group.
 boolean removeGroup(ModelGroup group)
          Removes the given ModelGroup Definition from this Group.
 boolean removeWildcard(Wildcard wildcard)
          Removes the given Wildcard from this Group.
 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 element the class ModelGroup has been created
 void setName(java.lang.String name)
          Sets the name of this Group
 void setOrder(Order order)
          Sets the Order option for this Group
protected  void setParent(Structure parent)
          Sets the parent for this Group
 void validate()
          Checks the validity of this Group defintion.
 
Methods inherited from class org.exolab.castor.xml.schema.Particle
getMaxOccurs, getMinOccurs, setMaxOccurs, setMinOccurs
 
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
 
Methods inherited from interface org.exolab.castor.xml.schema.ContentModelGroup
getMaxOccurs, getMinOccurs
 

Constructor Detail

Group

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


Group

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

Parameters:
name - of the Group
Method Detail

addWildcard

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

Specified by:
addWildcard in interface ContentModelGroup
Parameters:
WildCard - the wildcard to add
Throws:
SchemaException - thrown when the wildcard is an element

removeWildcard

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

Specified by:
removeWildcard in interface ContentModelGroup
Parameters:
wilcard - the Wildcard to remove.
Returns:
true if the wildcard has been successfully removed, false otherwise.

getContentModelGroup

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

Returns:
the ContentModelGroup for this group

getId

public java.lang.String getId()
Returns the ID for this Group

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

getName

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

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


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 (, , or tags.

getReferenceId

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

Specified by:
getReferenceId in interface Referable
Returns:
the Id used to Refer to this Object
See Also:
Referable

setName

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

Parameters:
name - the new name for this Group

setId

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

Parameters:
id - the ID 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

addElementDecl

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

Specified by:
addElementDecl in interface ContentModelGroup
Parameters:
elementDecl - the ElementDecl to add
Throws:
SchemaException - when an ElementDecl already exists with the same name as the given ElementDecl

removeElementDecl

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

Specified by:
removeElementDecl in interface ContentModelGroup
Parameters:
elementDecl - the ElementDecl to remove.
Returns:
true if the element has been successfully removed, false otherwise.

addGroup

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

Specified by:
addGroup in interface 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

removeGroup

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

Specified by:
removeGroup in interface ContentModelGroup
Parameters:
group - the Group to remove.
Returns:
true if the group has been successfully removed, false otherwise.

addGroup

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

Specified by:
addGroup in interface ContentModelGroup
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

removeGroup

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

Specified by:
removeGroup in interface ContentModelGroup
Parameters:
group - the ModelGroup Definition to remove.
Returns:
true if the group has been successfully removed, false otherwise.

enumerate

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

Specified by:
enumerate in interface ContentModelGroup
Returns:
an enumeration of the Particles contained within this ContentModelGroup

getElementDecl

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

Specified by:
getElementDecl in interface ContentModelGroup
Parameters:
name - the name of the element.
Returns:
the ElementDecl with the given name, or null if no ElementDecl exists in this ContentModelGroup.

getParticle

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

Specified by:
getParticle in interface ContentModelGroup
Parameters:
index - the index of the particle to return

getParticleCount

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

Specified by:
getParticleCount in interface ContentModelGroup
Returns:
the number of particles

getStructureType

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

Specified by:
getStructureType in class Structure
Returns:
the type of this Schema Structure

hasAny

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

Returns:
method that returns true if this group contains an element.

validate

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

Specified by:
validate in class Structure
Throws:
ValidationException - when this Group definition is invalid.

setParent

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

Parameters:
parent - the parent Structure for this Group


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