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:
Serializable
,ContentModelGroup
,Referable
- Direct Known Subclasses:
ModelGroup
An XML Schema Group
- Version:
- $Revision: 7996 $ $Date: 2006-04-14 04:14:43 -0600 (Fri, 14 Apr 2006) $
- Author:
- Keith Visco
- See Also:
-
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addElementDecl
(ElementDecl elementDecl) Adds the given ElementDecl to this ContentModelGroup.void
Adds the givenGroup
to thisContentModelGroup
.void
addGroup
(ModelGroup group) Adds the givenModelGroup
definition to thisContentModelGroup
.void
addWildcard
(Wildcard wildcard) Adds the givenWildcard
to thisContentModelGroup
.Returns an enumeration of all theParticle
s contained within thisContentModelGroup
.Returns theContentModelGroup
for this group.getElementDecl
(String name) Returns the element declaration with the given name, or null if no element declaration with that name exists in thisContentModelGroup
.getId()
Returns the ID for thisGroup
.getName()
Returns the name of thisGroup
, or null if no name was defined.getOrder()
Returns the compositor for thisGroup
.Returns the parent of this Group, this value may be null if no parent has been set.getParticle
(int index) Returns theParticle
at the specified index.int
Returns the number of particles contained within thisContentModelGroup
.Returns the Id used to refer to this Object.short
Returns the type of this Schema Structure.boolean
hasAny()
A helper method that returns true if this group contains an <any> element.boolean
Indicates whether thisParticle
is 'emptiable'boolean
Deprecated.boolean
removeElementDecl
(ElementDecl element) Removes the given ElementDecl from this ContentModelGroup.boolean
removeGroup
(Group group) Removes the givenGroup
from thisContentModelGroup
.boolean
removeGroup
(ModelGroup group) Removes the givenModelGroup
definition from thisContentModelGroup
.boolean
removeWildcard
(Wildcard wildcard) Removes the givenWildcard
from thisContentModelGroup
.void
Sets the ID for thisGroup
.void
setIsModelGroupDefinition
(boolean isModelGroupDefinition) Deprecated.Since Castor 0.9.2, to handle properly theelement the class ModelGroup has been created void
Sets the name of thisGroup
.void
protected void
Sets the parent for thisGroup
.void
validate()
Checks the validity of thisGroup
defintion.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
-
Constructor Details
-
Method Details
-
addWildcard
Adds the givenWildcard
to thisContentModelGroup
.- Specified by:
addWildcard
in interfaceContentModelGroup
- Parameters:
wildcard
- theWildcard
to add- Throws:
SchemaException
- when theWildcard
is <anyAttribute> and not <any>- See Also:
-
removeWildcard
Removes the givenWildcard
from thisContentModelGroup
.- Specified by:
removeWildcard
in interfaceContentModelGroup
- Parameters:
wildcard
- theWildcard
to remove.- Returns:
- true if the given
Wildcard
has been successfully removed, false otherwise. - See Also:
-
getContentModelGroup
Returns theContentModelGroup
for this group. Only used for aelement - Returns:
- the ContentModelGroup for this group
-
getId
Returns the ID for thisGroup
.- Returns:
- the ID for this
Group
, or null if no ID is present
-
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
Returns the compositor for thisGroup
.- Returns:
- the compositor for this
Group
-
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:
-
isModelGroupDefinition
public boolean isModelGroupDefinition()Deprecated.Since Castor 0.9.2, to handle properly theelement the class ModelGroup
has 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:
-
getReferenceId
Returns the Id used to refer to this Object.- Specified by:
getReferenceId
in interfaceReferable
- Returns:
- the Id used to refer to this Object
- See Also:
-
setName
Sets the name of thisGroup
.- Parameters:
name
- the new name for thisGroup
-
setId
Sets the ID for thisGroup
.- Parameters:
id
- the ID for thisGroup
-
setOrder
-
addElementDecl
Adds the given ElementDecl to this ContentModelGroup.- Specified by:
addElementDecl
in interfaceContentModelGroup
- Parameters:
elementDecl
- the ElementDecl to add- Throws:
SchemaException
- when an ElementDecl already exists with the same name as the given ElementDecl- See Also:
-
removeElementDecl
Removes the given ElementDecl from this ContentModelGroup.- Specified by:
removeElementDecl
in interfaceContentModelGroup
- Parameters:
element
- the ElementDecl to remove.- Returns:
- true if the element has been successfully removed, false otherwise.
- See Also:
-
addGroup
Adds the givenGroup
to thisContentModelGroup
.- Specified by:
addGroup
in 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:
-
removeGroup
Removes the givenGroup
from thisContentModelGroup
.- Specified by:
removeGroup
in interfaceContentModelGroup
- Parameters:
group
- the Group to remove.- Returns:
- true if the group has been successfully removed, false otherwise.
- See Also:
-
addGroup
Adds the givenModelGroup
definition to thisContentModelGroup
.- Specified by:
addGroup
in 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:
-
removeGroup
Removes the givenModelGroup
definition from thisContentModelGroup
.- Specified by:
removeGroup
in interfaceContentModelGroup
- Parameters:
group
- theModelGroup
definition to remove.- Returns:
- true if the group has been successfully removed, false otherwise.
- See Also:
-
enumerate
Returns an enumeration of all theParticle
s contained within thisContentModelGroup
.- Specified by:
enumerate
in interfaceContentModelGroup
- Returns:
- an enumeration of all the
Particle
s contained within thisContentModelGroup
- See Also:
-
getElementDecl
Returns the element declaration with the given name, or null if no element declaration with that name exists in thisContentModelGroup
.- Specified by:
getElementDecl
in interfaceContentModelGroup
- Parameters:
name
- the name of the element.- Returns:
- the
ElementDecl
with the given name, or null if no ElementDecl exists in thisContentModelGroup
. - See Also:
-
getParticle
Returns theParticle
at the specified index.- Specified by:
getParticle
in interfaceContentModelGroup
- Parameters:
index
- the index of theParticle
to return- Returns:
- the CMParticle at the specified index
- See Also:
-
getParticleCount
public int getParticleCount()Returns the number of particles contained within thisContentModelGroup
.- Specified by:
getParticleCount
in interfaceContentModelGroup
- Returns:
- the number of particles
- See Also:
-
getStructureType
public short getStructureType()Returns the type of this Schema Structure.- Specified by:
getStructureType
in classStructure
- Returns:
- the type of this Schema Structure.
- See Also:
-
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
Checks the validity of thisGroup
defintion.- Specified by:
validate
in classStructure
- Throws:
ValidationException
- when thisGroup
definition is invalid.
-
setParent
Sets the parent for thisGroup
. -
isEmptiable
public boolean isEmptiable()Indicates whether thisParticle
is 'emptiable'- Overrides:
isEmptiable
in classParticle
- Returns:
- true if this Particle is 'emptiable'
-
ModelGroup
has been created