com.saxonica.schema
Class ModelGroupDefinition

java.lang.Object
  extended bycom.saxonica.schema.SchemaStructure
      extended bycom.saxonica.schema.AbstractParticle
          extended bycom.saxonica.schema.Compositor
              extended bycom.saxonica.schema.ModelGroupDefinition
All Implemented Interfaces:
Particle, SchemaComponent, java.io.Serializable, javax.xml.transform.SourceLocator, Term, UserSchemaComponent

public class ModelGroupDefinition
extends Compositor

A Model Group Definition: a schema component corresponding to a top-level (named) xs:group element in a schema document.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.saxonica.schema.Compositor
contentModel
 
Fields inherited from class com.saxonica.schema.AbstractParticle
UNBOUNDED
 
Fields inherited from interface net.sf.saxon.type.SchemaComponent
FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING
 
Constructor Summary
ModelGroupDefinition(PreparedSchema schema, javax.xml.transform.SourceLocator locator)
          Creates a new Group definition
 
Method Summary
 Compositor getContentModelGroup()
          Returns the ContentModelGroup for this group Only used for a element
 int getFingerprint()
           
 java.lang.String getName()
          Returns the name of this Group.
 boolean isEmptiable()
          Determine if empty content is allowed
 boolean isSameGroup(ModelGroupDefinition other)
          Test whether this is the same type as another type.
 void lookForCycles(PreparedSchema schema, java.util.Stack references)
          This method is called to look for cycles.
 void setFingerprint(int fingerprint)
           
 void setName(java.lang.String name)
          Set the name of the group
 void setRedefinedModelGroupDefinition(ModelGroupDefinition other)
          Set the model group definition that this one redefines.
 boolean validate(PreparedSchema schema)
          Checks the validity of this Schema definition.
 
Methods inherited from class com.saxonica.schema.Compositor
addParticle, checkElements, compile, containsAll, fixup, getElementParticleCardinality, getElementParticleType, getTerm, isEmpty, iterateParticles, rewrite
 
Methods inherited from class com.saxonica.schema.AbstractParticle
getMaxOccurs, getMinOccurs, setMaxOccurs, setMinOccurs
 
Methods inherited from class com.saxonica.schema.SchemaStructure
getColumnNumber, getFixupStatus, getLineNumber, getPublicId, getSchema, getSystemId, getValidationStatus, setFixupStatus, setLineNumber, setLocator, setSchema, setSystemId, setValidationStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.saxon.type.SchemaComponent
getValidationStatus
 

Constructor Detail

ModelGroupDefinition

public ModelGroupDefinition(PreparedSchema schema,
                            javax.xml.transform.SourceLocator locator)
Creates a new Group definition

Parameters:
schema - the XML Schema to which this Group belongs
Method Detail

setName

public void setName(java.lang.String name)
Set the name of the group


setRedefinedModelGroupDefinition

public void setRedefinedModelGroupDefinition(ModelGroupDefinition other)
Set the model group definition that this one redefines. Only set if this is a redefining model group that does not contain a self-reference; in this case validate() must check that it is a valid refinement


getContentModelGroup

public Compositor getContentModelGroup()
Returns the ContentModelGroup for this group Only used for a element

Returns:
the ContentModelGroup for this group

getFingerprint

public int getFingerprint()

setFingerprint

public void setFingerprint(int fingerprint)

getName

public java.lang.String getName()
Returns the name of this Group.

Returns:
the name of this Group.

isEmptiable

public boolean isEmptiable()
                    throws UnresolvedReferenceException
Determine if empty content is allowed

Throws:
UnresolvedReferenceException

lookForCycles

public void lookForCycles(PreparedSchema schema,
                          java.util.Stack references)
                   throws SchemaException,
                          UnresolvedReferenceException
This method is called to look for cycles. The object implementing this method is required (a) to raise an exception if the object itself appears in the list of references, (b) to add itself to the list of references, and (c) to call the lookForCycles method on all the objects that it references.

Specified by:
lookForCycles in interface UserSchemaComponent
Overrides:
lookForCycles in class Compositor
Parameters:
schema -
references - A list of objects that contain direct or indirect references to this object, and that must therefore not be referred to from this object.
Throws:
SchemaException
UnresolvedReferenceException

validate

public boolean validate(PreparedSchema schema)
                 throws SchemaException,
                        ValidationException
Checks the validity of this Schema definition.

Specified by:
validate in interface UserSchemaComponent
Overrides:
validate in class Compositor
Throws:
SchemaException
ValidationException

isSameGroup

public boolean isSameGroup(ModelGroupDefinition other)
Test whether this is the same type as another type. They are considered to be the same type if they are derived from the same type definition in the original XML representation (which can happen when there are multiple includes of the same file)