|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.saxonica.schema.SchemaStructure
com.saxonica.schema.AbstractParticle
com.saxonica.schema.Compositor
public abstract class Compositor
An XML Schema Compositor: choice, sequence, or all. Also used for a named model group
Field Summary |
---|
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 |
Fields inherited from interface com.saxonica.schema.SerializableSchemaComponent |
---|
ALL_COMPOSITOR, ATOMIC_TYPE, ATTRIBUTE_DECL, ATTRIBUTE_GROUP, ATTRIBUTE_GROUP_REF, ATTRIBUTE_USE, ATTRIBUTE_WILDCARD, CHOICE_COMPOSITOR, COMPLEX_TYPE, ELEMENT_DECL, ELEMENT_PARTICLE, ELEMENT_WILDCARD, FACET, KEY, KEYREF, LIST_TYPE, MODEL_GROUP, MODEL_GROUP_REF, NOTATION, SEQUENCE_COMPOSITOR, UNION_TYPE, UNIQUE |
Constructor Summary | |
---|---|
Compositor()
Creates a new Compositor, 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 compositor contains an xs:all compositor |
boolean |
fixup(SchemaCompiler compiler)
Check references from this component to other components |
void |
gatherAllPermittedElements(IntHashSet result)
Find the set of all element particles allowed within the content model of this particle, identified by their integer fingerprints. |
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 |
boolean |
isEmpty()
Return true if the content model is empty |
boolean |
isPointless(Particle 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 |
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.AbstractParticle |
---|
computeParticleCardinality, getMaxOccurs, getMinOccurs, setMaxOccurs, setMinOccurs |
Methods inherited from class com.saxonica.schema.SchemaStructure |
---|
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 net.sf.saxon.type.SchemaComponent |
---|
getValidationStatus |
Methods inherited from interface com.saxonica.schema.SerializableSchemaComponent |
---|
getComponentTypeCode, serialize |
Methods inherited from interface com.saxonica.schema.Particle |
---|
isEmptiable |
Constructor Detail |
---|
public Compositor()
Method Detail |
---|
public void addParticle(Particle particle)
particle
- the Particle to be addedpublic void setContentModel(List particles)
particles
- a List whose members are Particle objectspublic boolean isPointless(Particle container)
isPointless
in interface Particle
isPointless
in class AbstractParticle
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
-
SchemaException
UnresolvedReferenceException
public boolean validate(SchemaCompiler compiler) throws SchemaException, ValidationException
validate
in interface UserSchemaComponent
SchemaException
- when the error listener decides an error is fatal
ValidationException
public SchemaType getElementParticleType(int fingerprint)
getElementParticleType
in interface Particle
fingerprint
- Identifies the name of the child element within this content modelpublic int getElementParticleCardinality(int fingerprint) throws SchemaException, ValidationException
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.
getElementParticleCardinality
in interface Particle
fingerprint
- Identifies the name of the child element within this content model
SchemaException
ValidationException
public void gatherAllPermittedElements(IntHashSet result) throws SchemaException, ValidationException
gatherAllPermittedElements
in interface Particle
result
- an initially-empty integer set in which the results are accumulated
SchemaException
ValidationException
public void compile(SchemaCompiler compiler) throws SchemaException, ValidationException
compile
in interface Particle
compiler
-
SchemaException
- if compilation fails.
ValidationException
public boolean fixup(SchemaCompiler compiler) throws SchemaException, UnresolvedReferenceException
fixup
in interface UserSchemaComponent
compiler
- is used for reporting errors
SchemaException
UnresolvedReferenceException
public Term getTerm()
getTerm
in interface Particle
getTerm
in class AbstractParticle
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |