|
|||||||
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.SimpleComponentReference com.saxonica.schema.Particle com.saxonica.schema.ModelGroupParticle
public class ModelGroupParticle
A reference within the content model of a complex type to a Model Group Definition. Corresponds to a non-top-level xs:group element in a schema document, that is, an xs:group element with a ref attribute.
There is no direct equivalent of a GroupReference in the W3C schema component model,
because in that model the structure of a complex type is always fully expanded: that is,
any group references are replaced by the content of the group they refer to. This model
retains group references to allow late binding and redefinition. However, methods are
provided on the ModelGroup
class to give a view of the content model in which the
group references disappear.
Field Summary |
---|
Fields inherited from class com.saxonica.schema.Particle |
---|
UNBOUNDED |
Fields inherited from interface net.sf.saxon.type.SchemaComponent |
---|
FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING |
Constructor Summary | |
---|---|
ModelGroupParticle(SchemaAwareConfiguration config,
SourceLocator locator)
Creates a new Group reference |
Method Summary | |
---|---|
void |
compile(SchemaCompiler compiler)
Compile a particle |
boolean |
fixup(SchemaCompiler compiler)
Fix up references to other elements in the schema. |
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. |
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. |
int |
getFingerprint()
Get the fingerprint of the target of this reference |
ModelGroup |
getGroup()
|
int |
getSymbolSpace()
Get the symbol space of the target of this reference |
SchemaComponent |
getTarget()
Returns the group that this group object is a reference to. |
Term |
getTerm()
Get the term corresponding to this particle |
boolean |
isEmptiable()
Determine if empty content is allowed |
boolean |
isPointless(ModelGroup container)
Test whether the particle is pointless, as described in XML Schema Part 1 Schema Component Constraint: Particle Valid (Restriction) |
boolean |
isResolved()
Determine whether this reference has been resolved |
void |
lookForCycles(Stack references,
SchemaCompiler compiler)
This method is called to look for cycles. |
void |
serializeParticle(SchemaModelSerializer serializer)
Serialize the schema component as a particle |
void |
setFingerprint(int fingerprint)
|
void |
tryToResolve(SchemaCompiler compiler)
Attempt to resolved this reference using the groups defined in a given schema. |
boolean |
validate(SchemaCompiler compiler)
Checks the validity of this Schema definition. |
Methods inherited from class com.saxonica.schema.Particle |
---|
computeParticleCardinality, getMaxOccurs, getMinOccurs, setMaxOccurs, setMinOccurs |
Methods inherited from class com.saxonica.schema.SimpleComponentReference |
---|
getNameCode, setNameCode, setTarget |
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.ComponentReference |
---|
getConfiguration |
Methods inherited from interface javax.xml.transform.SourceLocator |
---|
getColumnNumber, getLineNumber, getPublicId, getSystemId |
Methods inherited from interface com.saxonica.schema.UserSchemaComponent |
---|
elaborate |
Methods inherited from interface net.sf.saxon.type.SchemaComponent |
---|
getValidationStatus |
Constructor Detail |
---|
public ModelGroupParticle(SchemaAwareConfiguration config, SourceLocator locator)
config
- the Configuration to which this Group belongsMethod Detail |
---|
public boolean isResolved()
isResolved
in interface ComponentReference
isResolved
in class SimpleComponentReference
public ModelGroup getGroup() throws UnresolvedReferenceException
UnresolvedReferenceException
public void setFingerprint(int fingerprint)
public int getFingerprint()
ComponentReference
getFingerprint
in interface ComponentReference
getFingerprint
in class SimpleComponentReference
public int getSymbolSpace()
getSymbolSpace
in interface ComponentReference
getSymbolSpace
in class SimpleComponentReference
public boolean isEmptiable() throws UnresolvedReferenceException
isEmptiable
in class Particle
UnresolvedReferenceException
public boolean fixup(SchemaCompiler compiler) throws SchemaException
fixup
in interface UserSchemaComponent
fixup
in class Particle
compiler
-
SchemaException
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 SchemaComponent getTarget() throws UnresolvedReferenceException
getTarget
in interface ComponentReference
getTarget
in class SimpleComponentReference
UnresolvedReferenceException
- if the reference has not been resolved. Note that
this is an unchecked exception.public void tryToResolve(SchemaCompiler compiler)
tryToResolve
in interface ComponentReference
tryToResolve
in class SimpleComponentReference
compiler
- The compiler being used to compile the referring component.
This is assumed to know about the schema containing the candidate target components for the reference. If
null, the schema containing the reference is used.public boolean isPointless(ModelGroup container)
isPointless
in class Particle
public SchemaType getElementParticleType(int fingerprint)
getElementParticleType
in class Particle
fingerprint
- Identifies the name of the child element within this content modelpublic 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.
getElementParticleCardinality
in class Particle
fingerprint
- Identifies the name of the child element within this content modelpublic void gatherAllPermittedElements(IntHashSet result, boolean ignoreWildcards) throws SchemaException
gatherAllPermittedElements
in class Particle
result
- an initially-empty integer set in which the results are accumulatedignoreWildcards
-
SchemaException
public boolean validate(SchemaCompiler compiler) throws SchemaException
validate
in interface UserSchemaComponent
validate
in class Particle
SchemaException
public void compile(SchemaCompiler compiler) throws SchemaException
compile
in class Particle
compiler
-
SchemaException
public Term getTerm()
getTerm
in class Particle
public void serializeParticle(SchemaModelSerializer serializer) throws XPathException
serializeParticle
in class Particle
XPathException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |