|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.saxonica.schema.SchemaStructure com.saxonica.schema.ModelGroup
public abstract class ModelGroup
An XML Schema Model Group. This corresponds to a sequence, choice, or all in the
schema document representation. The model group is typically referenced by a
ModelGroupParticle, which links it into some containing content model. Named model
groups, corresponding to global xs:group elements in a schema document, are represented
by the subclass ModelGroupDefinition
.
Field Summary |
---|
Fields inherited from interface net.sf.saxon.type.SchemaComponent |
---|
FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING |
Constructor Summary | |
---|---|
ModelGroup()
Creates a new ModelGroup, with no name |
Method Summary | |
---|---|
void |
addParticle(Particle particle)
Adds a given Particle to the content model defined by this Compositor |
void |
compile(SchemaCompiler compiler)
Compile this Compositor by compiling each of the particles contained in its content model. |
boolean |
containsAll(boolean simplified)
Test whether this model group contains an xs:all compositor |
boolean |
fixup(SchemaCompiler compiler)
Check references from this component to other components |
void |
gatherAllPermittedElements(IntHashSet result,
boolean ignoreWildcards)
Find the set of all element particles allowed within the content model of this particle, identified by their integer fingerprints. |
abstract String |
getCompositorName()
Get the name of the compositor used in this model group |
int |
getContentModelSize()
Get the number of particles in the (unsimplified) content model |
int |
getElementParticleCardinality(int fingerprint)
Find an element particle within this complex type definition having a given element name (identified by fingerprint), and return the cardinality associated with that element particle, that is, the number of times the element can occur within this complex type. |
SchemaType |
getElementParticleType(int fingerprint)
Find an element particle within this complex type definition having a given element name (identified by fingerprint), and return the schema type associated with that element particle. |
List |
getListOfParticles(boolean simplified)
Get the list of particles |
List |
getSimplifiedContentModel()
Remove pointless particles from this content model (recursively), and replace group references by the content of the identified group |
Term |
getTerm()
Get the term corresponding to this particle |
abstract boolean |
isEmptiable()
Determine if empty content is allowed |
boolean |
isEmpty()
Return true if the content model is empty |
boolean |
isPointless(ModelGroup container)
Test whether the particle is pointless, as described in XML Schema Part 1 Schema Component Constraint: Particle Valid (Restriction) |
Iterator |
iterateParticles()
Iterate over the Particles of the content model defined by this Compositor. |
void |
lookForCycles(Stack references,
SchemaCompiler compiler)
This method is called to look for cycles. |
void |
serialize(SchemaModelSerializer serializer)
Serialize the schema component |
void |
setContentModel(List particles)
Set the entire content model |
boolean |
validate(SchemaCompiler compiler)
Checks the validity of this Compositor definition. |
Methods inherited from class com.saxonica.schema.SchemaStructure |
---|
elaborate, getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getSystemId, getValidationStatus, setConfiguration, setFixupStatus, setLineNumber, setLocator, setSystemId, setValidationStatus |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.saxonica.schema.UserSchemaComponent |
---|
elaborate |
Methods inherited from interface net.sf.saxon.type.SchemaComponent |
---|
getValidationStatus |
Constructor Detail |
---|
public ModelGroup()
Method Detail |
---|
public abstract String getCompositorName()
public void addParticle(Particle particle)
particle
- the Particle to be addedpublic void setContentModel(List particles)
particles
- a List whose members are Particle objectspublic abstract boolean isEmptiable() throws UnresolvedReferenceException
UnresolvedReferenceException
public boolean isPointless(ModelGroup container)
container
- not used
public Iterator iterateParticles()
public List getListOfParticles(boolean simplified)
simplified
- set to true if the simplified content model is required
(that is, the model after removing pointless particles and expanding group references)
public int getContentModelSize()
public boolean isEmpty()
public boolean containsAll(boolean simplified) throws UnresolvedReferenceException
simplified
- set to false if we want to look at the original unsimplified
content model, to true if we want the model after removing pointless particles
UnresolvedReferenceException
public List getSimplifiedContentModel()
public void lookForCycles(Stack references, SchemaCompiler compiler) throws SchemaException, UnresolvedReferenceException
lookForCycles
in interface UserSchemaComponent
lookForCycles
in class SchemaStructure
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.compiler
- used for error reporting
SchemaException
UnresolvedReferenceException
public boolean validate(SchemaCompiler compiler) throws SchemaException
validate
in interface UserSchemaComponent
SchemaException
- when the error listener decides an error is fatalpublic SchemaType getElementParticleType(int fingerprint)
fingerprint
- Identifies the name of the child element within this content model
public int getElementParticleCardinality(int fingerprint)
StaticProperty.EXACTLY_ONE
, StaticProperty.ALLOWS_ZERO_OR_ONE
,
StaticProperty.ALLOWS_ZERO_OR_MORE
, StaticProperty.ALLOWS_ONE_OR_MORE
,
If there is no such particle, return zero.
fingerprint
- Identifies the name of the child element within this content model
public void gatherAllPermittedElements(IntHashSet result, boolean ignoreWildcards) throws SchemaException
result
- an initially-empty integer set in which the results are accumulatedignoreWildcards
- if true, wildcards are ignored. If false, the result will be
an integer set containing the value -1, meaning that it is not possible to enumerate
the elements that can appear in the content.
SchemaException
public void compile(SchemaCompiler compiler) throws SchemaException
compiler
- used for error reporting
SchemaException
- if compilation fails.public boolean fixup(SchemaCompiler compiler) throws SchemaException, UnresolvedReferenceException
fixup
in interface UserSchemaComponent
fixup
in class SchemaStructure
compiler
- is used for reporting errors
SchemaException
UnresolvedReferenceException
public Term getTerm()
public void serialize(SchemaModelSerializer serializer) throws XPathException
serializer
- used to receive the serialized output
XPathException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |