public class ModelGroupParticle extends Particle implements ComponentReference
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.
nameCode, symbolSpace, target
COMPONENT_FUNCTION_TYPE, FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING
Constructor and Description |
---|
ModelGroupParticle(EnterpriseConfiguration config,
SourceLocator locator)
Creates a new Group reference
|
Modifier and Type | Method and Description |
---|---|
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.
|
computeParticleCardinality, getComponentAsFunction, getMaxOccurs, getMinOccurs, isVulnerable, setMaxOccurs, setMinOccurs, setVulnerable
getFingerprint, getNameCode, setNameCode, setTarget
getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, makeXPathExpressionPropertyRecord, setConfiguration, setFixupStatus, setLineNumber, setLocator, setRedefinitionLevel, setSchemaDocumentURI, setSystemId, setValidationStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConfiguration, getFingerprint
getColumnNumber, getLineNumber, getPublicId, getSystemId
getRedefinitionLevel, getValidationStatus
public ModelGroupParticle(EnterpriseConfiguration config, SourceLocator locator)
config
- the Configuration to which this Group belongslocator
- the location of the corresponding declaration in the source schema documentpublic 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
- if the schema contains an unresolved reference to a required componentpublic boolean fixup(SchemaCompiler compiler) throws SchemaException
fixup
in interface UserSchemaComponent
fixup
in class Particle
compiler
- the schema compilerSchemaException
- if a fatal error occurspublic 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
- The schema compilerSchemaException
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
container
- the model group containing this particle; null if there is no containing model grouppublic 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 modelpublic 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
- true if wildcard particles are to be ignored. If false, the resulting set
will include the value -1 if wildcards are present in the content modelSchemaException
- if an error is found in the schemapublic void markVulnerableSubParticles()
markVulnerableSubParticles
in class Particle
public boolean validate(SchemaCompiler compiler) throws SchemaException
validate
in interface UserSchemaComponent
validate
in class Particle
compiler
- the schema compilerSchemaException
public void compile(SchemaCompiler compiler) throws SchemaException
compile
in class Particle
compiler
- the schema compmilerSchemaException
- if a fatal error occurspublic Term getTerm()
public void elaborate(SchemaCompiler compiler) throws SchemaException
elaborate
in interface UserSchemaComponent
elaborate
in class SchemaStructure
compiler
- the schema compilerSchemaException
- if the schema is found to be invalidpublic void serializeParticle(SchemaModelSerializer serializer) throws XPathException
serializeParticle
in class Particle
serializer
- the object responsible for serializationXPathException
- if serialization failsCopyright (c) 2004-2013 Saxonica Limited. All rights reserved.