public class ModelGroupParticle extends Particle
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.
SchemaComponent.ValidationStatus
symbolSpace, target
COMPONENT_FUNCTION_TYPE
Constructor and Description |
---|
ModelGroupParticle(EnterpriseConfiguration config,
javax.xml.transform.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 elementName)
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 elementName)
Find an element particle within this complex type definition having a given element name
(identified by elementName), 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(java.util.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
getTargetComponentName, getTargetFingerprint, isDangling, setTarget, setTargetComponentName
getColumnNumber, getConfiguration, getFixupStatus, getGeneratedId, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, hasSameLocation, isValidationNeeded, makeXPathExpressionPropertyRecord, saveLocation, setConfiguration, setFixupStatus, setGeneratedId, setLineNumber, setLocator, setRedefinitionLevel, setSchemaDocumentURI, setSystemId, setValidationStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRedefinitionLevel, getValidationStatus
getConfiguration
getColumnNumber, getLineNumber, getPublicId, getSystemId, saveLocation
public ModelGroupParticle(EnterpriseConfiguration config, javax.xml.transform.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 MissingComponentException
MissingComponentException
public int getSymbolSpace()
getSymbolSpace
in interface ComponentReference
getSymbolSpace
in class SimpleComponentReference
public boolean isEmptiable() throws MissingComponentException
isEmptiable
in class Particle
MissingComponentException
- 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(java.util.Stack references, SchemaCompiler compiler) throws SchemaException, MissingComponentException
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
MissingComponentException
public SchemaComponent getTarget() throws MissingComponentException
getTarget
in interface ComponentReference
getTarget
in class SimpleComponentReference
MissingComponentException
- 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) throws MissingComponentException
isPointless
in class Particle
container
- the model group containing this particle; null if there is no containing model groupMissingComponentException
public SchemaType getElementParticleType(int elementName) throws MissingComponentException
getElementParticleType
in class Particle
elementName
- Identifies the name of the child element within this content modelMissingComponentException
public int getElementParticleCardinality(int elementName) throws MissingComponentException
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
elementName
- Identifies the name of the child element within this content modelMissingComponentException
public boolean containsElementWildcard() throws MissingComponentException
containsElementWildcard
in class Particle
MissingComponentException
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 setSchemaException
- if an error is found in the schemapublic void markVulnerableSubParticles() throws MissingComponentException
markVulnerableSubParticles
in class Particle
MissingComponentException
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() throws MissingComponentException
getTerm
in class Particle
MissingComponentException
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 writing the serialized form to the destination failsMissingComponentException
- if the schema cannot be serialized because some components are missing.Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.