org.exolab.castor.xml.schema
Class ContentModelGroupImpl

java.lang.Object
  extended by 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
ContentModelGroupImpl()
           
 
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 ContentModelGroup.
 void addWildcard(Wildcard wildcard)
          Adds the given Wildcard to this ContentModelGroup.
 java.util.Enumeration<Particle> enumerate()
          Returns an enumeration of all the Particles contained within this ContentModelGroup.
 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.
 int getMaxOccurs()
          Returns the maximum number of occurrences that this ContentModelGroup may appear.
 int getMinOccurs()
          Returns the minimum number of occurrences that this ContentModelGroup must appear.
 Particle getParticle(int index)
          Returns the Particle at the specified index.
 int getParticleCount()
          Returns the number of particles contained within this ContentModelGroup.
 boolean removeElementDecl(ElementDecl elementDecl)
          Removes the given ElementDecl from this ContentModelGroup.
 boolean removeGroup(Group group)
          Removes the given Group from this ContentModelGroup.
 boolean removeGroup(ModelGroup group)
          Removes the given ModelGroup definition from this ContentModelGroup.
 boolean removeWildcard(Wildcard wildcard)
          Removes the given Wildcard from this ContentModelGroup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentModelGroupImpl

ContentModelGroupImpl()
Method Detail

addWildcard

public void addWildcard(Wildcard wildcard)
                 throws SchemaException
Adds the given Wildcard to this ContentModelGroup.

Specified by:
addWildcard in interface ContentModelGroup
Parameters:
wildcard - the Wildcard to add
Throws:
SchemaException - when the Wildcard is <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:
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
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:
removeElementDecl in interface ContentModelGroup
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 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
See Also:
ContentModelGroup.addGroup(org.exolab.castor.xml.schema.Group)

removeGroup

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

Specified by:
removeGroup in interface ContentModelGroup
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 given ModelGroup definition to this ContentModelGroup.

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
See Also:
ContentModelGroup.addGroup(org.exolab.castor.xml.schema.ModelGroup)

removeGroup

public boolean removeGroup(ModelGroup group)
Removes the given ModelGroup definition from this ContentModelGroup.

Specified by:
removeGroup in interface ContentModelGroup
Parameters:
group - the ModelGroup definition 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 given Wildcard from this ContentModelGroup.

Specified by:
removeWildcard in interface ContentModelGroup
Parameters:
wildcard - the Wildcard to remove.
Returns:
true if the given Wildcard has 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 the Particles contained within this ContentModelGroup.

Specified by:
enumerate in interface ContentModelGroup
Returns:
an enumeration of all the Particles contained within this ContentModelGroup
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 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.
See Also:
ContentModelGroup.getElementDecl(java.lang.String)

getMaxOccurs

public int getMaxOccurs()
Returns the maximum number of occurrences that this ContentModelGroup may appear.

Specified by:
getMaxOccurs in interface ContentModelGroup
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:
getMinOccurs in interface ContentModelGroup
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 the Particle at the specified index.

Specified by:
getParticle in interface ContentModelGroup
Parameters:
index - the index of the Particle to return
Returns:
the CMParticle at the specified index
See Also:
ContentModelGroup.getParticle(int)

getParticleCount

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

Specified by:
getParticleCount in interface ContentModelGroup
Returns:
the number of particles
See Also:
ContentModelGroup.getParticleCount()


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