|
||||||||||
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
An XML Schema Compositor: choice, sequence, or all. Also used for a group
Field Summary | |
protected java.util.List |
contentModel
The list of particles making up the content model of this ModelGroup. |
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 | |
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 |
protected boolean |
checkElements(IntHashMap map,
PreparedSchema schema)
Check that the elements defined as particles in this compositor are consistent |
void |
compile(PreparedSchema schema,
UserComplexType subjectType)
Compile this Compositor by compiling each of the particles contained in its content model. |
boolean |
containsAll()
Test whether this compositor contains an xs:all compositor |
boolean |
fixup(PreparedSchema schema)
Check references from this component to other components |
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. |
Term |
getTerm()
Get the term corresponding to this particle |
boolean |
isEmpty()
Return true if the content model is empty |
java.util.Iterator |
iterateParticles()
Iterate over the Particles of the content model defined by this Compositor. |
void |
lookForCycles(PreparedSchema schema,
java.util.Stack references)
This method is called to look for cycles. |
void |
rewrite()
Rewrite a particle prior to compiling it |
boolean |
validate(PreparedSchema schema)
Checks the validity of this Compositor definition. |
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 |
Methods inherited from interface com.saxonica.schema.Particle |
isEmptiable |
Field Detail |
protected java.util.List contentModel
Constructor Detail |
public Compositor()
Method Detail |
public void addParticle(Particle particle) throws SchemaException
particle
- the Particle to be added
SchemaException
- if this particle cannot be added,
for example when a group with the same name as the
specified group already exists in the current scopepublic java.util.Iterator iterateParticles()
public boolean isEmpty()
public boolean containsAll() throws UnresolvedReferenceException
UnresolvedReferenceException
public void lookForCycles(PreparedSchema schema, java.util.Stack references) throws SchemaException, UnresolvedReferenceException
lookForCycles
in interface UserSchemaComponent
lookForCycles
in class SchemaStructure
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.
SchemaException
UnresolvedReferenceException
public boolean validate(PreparedSchema schema) throws SchemaException, ValidationException
validate
in interface UserSchemaComponent
schema
- if this is not null, any errors that are detected should
be reported using the error() method of this schema.
SchemaException
- when the error listener decides an error is fatal
ValidationException
protected boolean checkElements(IntHashMap map, PreparedSchema schema) throws SchemaException, UnresolvedReferenceException
map
- a HashMap that maps integers to ElementDecl's
SchemaException
UnresolvedReferenceException
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 rewrite()
rewrite
in interface Particle
rewrite
in class AbstractParticle
public void compile(PreparedSchema schema, UserComplexType subjectType) throws SchemaException, ValidationException
compile
in interface Particle
schema
- The containing schema (used to generate error messages)subjectType
- The containing complex type (used so that this can be registered with any
elements appearing as particles in the content model, so that the complex type can be recompiled
if the substitution group membership of the element declaration subsequently changes)
SchemaException
- if compilation fails.
ValidationException
public boolean fixup(PreparedSchema schema) throws SchemaException, UnresolvedReferenceException
fixup
in interface UserSchemaComponent
schema
- The schema 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 |