Package org.exolab.castor.xml.schema
Class ContentModelGroupImpl
- java.lang.Object
-
- org.exolab.castor.xml.schema.ContentModelGroupImpl
-
- All Implemented Interfaces:
java.io.Serializable,ContentModelGroup
class ContentModelGroupImpl extends java.lang.Object implements ContentModelGroup, java.io.Serializable
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 Constructor Description ContentModelGroupImpl()
-
Method Summary
All Methods Instance Methods Concrete 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<Particle>enumerate()Returns an enumeration of all theParticles contained within thisContentModelGroup.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.intgetMaxOccurs()Returns the maximum number of occurrences that this ContentModelGroup may appear.intgetMinOccurs()Returns the minimum number of occurrences that this ContentModelGroup must appear.ParticlegetParticle(int index)Returns theParticleat the specified index.intgetParticleCount()Returns the number of particles contained within thisContentModelGroup.booleanremoveElementDecl(ElementDecl elementDecl)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.
-
-
-
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)
-
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 elementDecl)
Removes the given ElementDecl from this ContentModelGroup.- Specified by:
removeElementDeclin interfaceContentModelGroup- Parameters:
elementDecl- 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)
-
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)
-
enumerate
public java.util.Enumeration<Particle> 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)
-
getMaxOccurs
public int getMaxOccurs()
Returns the maximum number of occurrences that this ContentModelGroup may appear.- Specified by:
getMaxOccursin interfaceContentModelGroup- Returns:
- the maximum number of occurrences that this ContentModelGroup may appear. A non positive (n < 1) value indicates that the value is unspecified (ie. unbounded).
- See Also:
ContentModelGroup.getMaxOccurs()
-
getMinOccurs
public int getMinOccurs()
Returns the minimum number of occurrences that this ContentModelGroup must appear.- Specified by:
getMinOccursin interfaceContentModelGroup- Returns:
- the minimum number of occurrences that this ContentModelGroup must appear A negative (n < 0) value indicates that the value is unspecified.
- See Also:
ContentModelGroup.getMinOccurs()
-
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()
-
-