|
|||||||||
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 ModelGroupParticle 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 class com.saxonica.schema.SimpleComponentReference |
---|
nameCode, symbolSpace, target |
Fields inherited from interface net.sf.saxon.type.SchemaComponent |
---|
FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING |
Constructor Summary | |
---|---|
ModelGroupParticle(EnterpriseConfiguration config,
SourceLocator locator)
Creates a new Group reference |
Method Summary | |
---|---|
void |
compile(SchemaCompiler compiler)
Compile a particle |
boolean |
containsElementWildcard()
Ask whether the particle contains an element wildcard |
void |
elaborate(SchemaCompiler compiler)
Elaborate the schema component: after reloading a serialized schema component model, this expands the component with derived information needed during validation episodes. |
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. |
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 |
markVulnerableSubParticles()
Mark the vulnerable subParticles of this particle |
void |
serializeParticle(SchemaModelSerializer serializer)
Serialize the schema component as a particle |
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, isVulnerable, setMaxOccurs, setMinOccurs, setVulnerable |
Methods inherited from class com.saxonica.schema.SimpleComponentReference |
---|
getFingerprint, getNameCode, setNameCode, setTarget |
Methods inherited from class com.saxonica.schema.SchemaStructure |
---|
getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, setConfiguration, setFixupStatus, setLineNumber, setLocator, setRedefinitionLevel, setSchemaDocumentURI, setSystemId, setValidationStatus |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.saxonica.schema.ComponentReference |
---|
getConfiguration, getFingerprint |
Methods inherited from interface javax.xml.transform.SourceLocator |
---|
getColumnNumber, getLineNumber, getPublicId, getSystemId |
Methods inherited from interface net.sf.saxon.type.SchemaComponent |
---|
getRedefinitionLevel, getValidationStatus |
Constructor Detail |
---|
public ModelGroupParticle(EnterpriseConfiguration 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 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 StaticProperty.ALLOWS_ZERO
.
getElementParticleCardinality
in class Particle
fingerprint
- Identifies the name of the child element within this content model
public boolean containsElementWildcard()
containsElementWildcard
in class Particle
public 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 void markVulnerableSubParticles()
markVulnerableSubParticles
in class Particle
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 elaborate(SchemaCompiler compiler) throws SchemaException
elaborate
in interface UserSchemaComponent
elaborate
in class SchemaStructure
compiler
-
SchemaException
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 |