Package org.exolab.castor.xml.schema
Class Group
- java.lang.Object
-
- org.exolab.castor.xml.schema.Structure
-
- org.exolab.castor.xml.schema.Annotated
-
- org.exolab.castor.xml.schema.Particle
-
- 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: 7996 $ $Date: 2006-04-14 04:14:43 -0600 (Fri, 14 Apr 2006) $
- Author:
- Keith Visco
- See Also:
- Serialized Form
-
-
Field Summary
-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddElementDecl(ElementDecl elementDecl)Adds the given ElementDecl to this ContentModelGroup.voidaddGroup(Group group)Adds the givenGroupto thisContentModelGroup.voidaddGroup(ModelGroup group)Adds the givenModelGroupdefinition to thisContentModelGroup.voidaddWildcard(Wildcard wildcard)Adds the givenWildcardto thisContentModelGroup.java.util.Enumeration<Annotated>enumerate()Returns an enumeration of all theParticles contained within thisContentModelGroup.ContentModelGroupgetContentModelGroup()Returns theContentModelGroupfor this group.ElementDeclgetElementDecl(java.lang.String name)Returns the element declaration with the given name, or null if no element declaration with that name exists in thisContentModelGroup.java.lang.StringgetId()Returns the ID for thisGroup.java.lang.StringgetName()Returns the name of thisGroup, or null if no name was defined.OrdergetOrder()Returns the compositor for thisGroup.StructuregetParent()Returns the parent of this Group, this value may be null if no parent has been set.ParticlegetParticle(int index)Returns theParticleat the specified index.intgetParticleCount()Returns the number of particles contained within thisContentModelGroup.java.lang.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 <any> element.booleanisEmptiable()Indicates whether thisParticleis 'emptiable'booleanisModelGroupDefinition()Deprecated.Since Castor 0.9.2, to handle properly theelement the class ModelGrouphas been createdbooleanremoveElementDecl(ElementDecl element)Removes the given ElementDecl from this ContentModelGroup.booleanremoveGroup(Group group)Removes the givenGroupfrom thisContentModelGroup.booleanremoveGroup(ModelGroup group)Removes the givenModelGroupdefinition from thisContentModelGroup.booleanremoveWildcard(Wildcard wildcard)Removes the givenWildcardfrom thisContentModelGroup.voidsetId(java.lang.String id)Sets the ID for thisGroup.voidsetIsModelGroupDefinition(boolean isModelGroupDefinition)Deprecated.Since Castor 0.9.2, to handle properly theelement the class ModelGroup has been created voidsetName(java.lang.String name)Sets the name of thisGroup.voidsetOrder(Order order)protected voidsetParent(Structure parent)Sets the parent for thisGroup.voidvalidate()Checks the validity of thisGroupdefintion.-
Methods inherited from class org.exolab.castor.xml.schema.Particle
getMaxOccurs, getMinOccurs, isMaxOccursSet, isMinOccursSet, setMaxOccurs, setMinOccurs
-
Methods inherited from class org.exolab.castor.xml.schema.Annotated
addAnnotation, getAnnotations, removeAnnotation
-
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
-
-
-
-
Method Detail
-
addWildcard
public void addWildcard(Wildcard wildcard) throws SchemaException
Adds the givenWildcardto thisContentModelGroup.- Specified by:
addWildcardin interfaceContentModelGroup- Parameters:
wildcard- theWildcardto add- Throws:
SchemaException- when theWildcardis <anyAttribute> and not <any>- See Also:
ContentModelGroup.addWildcard(org.exolab.castor.xml.schema.Wildcard)
-
removeWildcard
public boolean removeWildcard(Wildcard wildcard)
Removes the givenWildcardfrom thisContentModelGroup.- Specified by:
removeWildcardin interfaceContentModelGroup- Parameters:
wildcard- theWildcardto remove.- Returns:
- true if the given
Wildcardhas been successfully removed, false otherwise. - See Also:
ContentModelGroup.removeWildcard(org.exolab.castor.xml.schema.Wildcard)
-
getContentModelGroup
public ContentModelGroup getContentModelGroup()
Returns theContentModelGroupfor this group. Only used for aelement - Returns:
- the ContentModelGroup for this group
-
getId
public java.lang.String getId()
Returns the ID for thisGroup.- Returns:
- the ID for this
Group, or null if no ID is present
-
getName
public java.lang.String getName()
Returns the name of thisGroup, 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 thisGroup.- 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 theelement the class ModelGroup has been created Sets if the group is a model group definition.- See Also:
ModelGroup
-
isModelGroupDefinition
public boolean isModelGroupDefinition()
Deprecated.Since Castor 0.9.2, to handle properly theelement the class ModelGrouphas been createdTells if the group is a model group definition.- Returns:
- true if the group is a model group definition (
tag), false otherwise <all/>, , or tags. - See Also:
ModelGroup
-
getReferenceId
public java.lang.String getReferenceId()
Returns the Id used to refer to this Object.- Specified by:
getReferenceIdin interfaceReferable- Returns:
- the Id used to refer to this Object
- See Also:
Referable
-
setName
public void setName(java.lang.String name)
Sets the name of thisGroup.- Parameters:
name- the new name for thisGroup
-
setId
public void setId(java.lang.String id)
Sets the ID for thisGroup.- Parameters:
id- the ID for thisGroup
-
setOrder
public void setOrder(Order order)
-
addElementDecl
public void addElementDecl(ElementDecl elementDecl) throws SchemaException
Adds the given ElementDecl to this ContentModelGroup.- Specified by:
addElementDeclin interfaceContentModelGroup- Parameters:
elementDecl- the ElementDecl to add- Throws:
SchemaException- when an ElementDecl already exists with the same name as the given ElementDecl- See Also:
ContentModelGroup.addElementDecl(org.exolab.castor.xml.schema.ElementDecl)
-
removeElementDecl
public boolean removeElementDecl(ElementDecl element)
Removes the given ElementDecl from this ContentModelGroup.- Specified by:
removeElementDeclin interfaceContentModelGroup- Parameters:
element- the ElementDecl to remove.- Returns:
- true if the element has been successfully removed, false otherwise.
- See Also:
ContentModelGroup.removeElementDecl(org.exolab.castor.xml.schema.ElementDecl)
-
addGroup
public void addGroup(Group group) throws SchemaException
Adds the givenGroupto thisContentModelGroup.- Specified by:
addGroupin interfaceContentModelGroup- 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- See Also:
ContentModelGroup.addGroup(org.exolab.castor.xml.schema.Group)
-
removeGroup
public boolean removeGroup(Group group)
Removes the givenGroupfrom thisContentModelGroup.- Specified by:
removeGroupin interfaceContentModelGroup- Parameters:
group- the Group to remove.- Returns:
- true if the group has been successfully removed, false otherwise.
- See Also:
ContentModelGroup.removeGroup(org.exolab.castor.xml.schema.Group)
-
addGroup
public void addGroup(ModelGroup group) throws SchemaException
Adds the givenModelGroupdefinition to thisContentModelGroup.- Specified by:
addGroupin interfaceContentModelGroup- 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- See Also:
ContentModelGroup.addGroup(org.exolab.castor.xml.schema.ModelGroup)
-
removeGroup
public boolean removeGroup(ModelGroup group)
Removes the givenModelGroupdefinition from thisContentModelGroup.- Specified by:
removeGroupin interfaceContentModelGroup- Parameters:
group- theModelGroupdefinition to remove.- Returns:
- true if the group has been successfully removed, false otherwise.
- See Also:
ContentModelGroup.removeGroup(org.exolab.castor.xml.schema.ModelGroup)
-
enumerate
public java.util.Enumeration<Annotated> enumerate()
Returns an enumeration of all theParticles contained within thisContentModelGroup.- Specified by:
enumeratein interfaceContentModelGroup- Returns:
- an enumeration of all the
Particles contained within thisContentModelGroup - See Also:
ContentModelGroup.enumerate()
-
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 thisContentModelGroup.- Specified by:
getElementDeclin interfaceContentModelGroup- Parameters:
name- the name of the element.- Returns:
- the
ElementDeclwith the given name, or null if no ElementDecl exists in thisContentModelGroup. - See Also:
ContentModelGroup.getElementDecl(java.lang.String)
-
getParticle
public Particle getParticle(int index)
Returns theParticleat the specified index.- Specified by:
getParticlein interfaceContentModelGroup- Parameters:
index- the index of theParticleto return- Returns:
- the CMParticle at the specified index
- See Also:
ContentModelGroup.getParticle(int)
-
getParticleCount
public int getParticleCount()
Returns the number of particles contained within thisContentModelGroup.- Specified by:
getParticleCountin interfaceContentModelGroup- Returns:
- the number of particles
- See Also:
ContentModelGroup.getParticleCount()
-
getStructureType
public short getStructureType()
Returns the type of this Schema Structure.- Specified by:
getStructureTypein classStructure- Returns:
- the type of this Schema Structure.
- See Also:
Structure.getStructureType()
-
hasAny
public boolean hasAny()
A helper method that returns true if this group contains an <any> element.- Returns:
- method that returns true if this group contains an <any> element.
-
validate
public void validate() throws ValidationExceptionChecks the validity of thisGroupdefintion.- Specified by:
validatein classStructure- Throws:
ValidationException- when thisGroupdefinition is invalid.
-
isEmptiable
public boolean isEmptiable()
Indicates whether thisParticleis 'emptiable'- Overrides:
isEmptiablein classParticle- Returns:
- true if this Particle is 'emptiable'
-
-