Package org.exolab.castor.xml.schema
Class ContentModelGroupImpl
java.lang.Object
org.exolab.castor.xml.schema.ContentModelGroupImpl
- All Implemented Interfaces:
Serializable
,ContentModelGroup
An implementation of an XML Schema content model group.
- Version:
- $Revision: 7996 $ $Date: 2006-04-14 04:14:43 -0600 (Fri, 14 Apr 2006) $
- Author:
- Keith Visco, Arnaud Blandin
-
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
.getElementDecl
(String name) Returns the element declaration with the given name, or null if no element declaration with that name exists in thisContentModelGroup
.int
Returns the maximum number of occurrences that this ContentModelGroup may appear.int
Returns the minimum number of occurrences that this ContentModelGroup must appear.getParticle
(int index) Returns theParticle
at the specified index.int
Returns the number of particles contained within thisContentModelGroup
.boolean
removeElementDecl
(ElementDecl elementDecl) 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
.
-
Constructor Details
-
ContentModelGroupImpl
ContentModelGroupImpl()
-
-
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:
-
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:
elementDecl
- 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:
-
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:
-
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:
-
getMaxOccurs
public int getMaxOccurs()Returns the maximum number of occurrences that this ContentModelGroup may appear.- Specified by:
getMaxOccurs
in interfaceContentModelGroup
- Returns:
- the maximum number of occurrences that this ContentModelGroup may appear. A non positive (n invalid input: '<' 1) value indicates that the value is unspecified (ie. unbounded).
- See Also:
-
getMinOccurs
public int getMinOccurs()Returns the minimum number of occurrences that this ContentModelGroup must appear.- Specified by:
getMinOccurs
in interfaceContentModelGroup
- Returns:
- the minimum number of occurrences that this ContentModelGroup must appear A negative (n invalid input: '<' 0) value indicates that the value is unspecified.
- 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:
-