public class ElementParticle extends Particle
symbolSpace, targetCOMPONENT_FUNCTION_TYPE, FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING| Constructor and Description |
|---|
ElementParticle(EnterpriseConfiguration config,
SourceLocator locator)
Creates a new element particle
|
| Modifier and Type | Method and Description |
|---|---|
void |
compile(SchemaCompiler compiler)
Compile this local element declaration, considered as a particle of some complex type,
by compiling its own complex type definition.
|
boolean |
containsElementWildcard()
Ask whether the particle contains an element wildcard
|
ElementParticle |
copy()
Copy an element particle
|
boolean |
fixup(SchemaCompiler compiler)
Check references from this component to other components
|
void |
gatherAllPermittedElements(HashSet<StructuredQName> result,
boolean ignoreWildcards)
Find the set of all element particles allowed within the content model of this particle, identified
by their integer fingerprints.
|
ElementDecl |
getDeclaration()
Returns the ElementDecl that this element definition references.
|
String |
getDisplayName()
Returns the display name of this Element particle.
|
int |
getElementParticleCardinality(StructuredQName 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(StructuredQName 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.
|
String |
getName()
Returns the local name of this Element particle.
|
String |
getNamespaceURI()
Get the namespace URI of this element particle
|
Term |
getTerm()
Get the term corresponding to this particle
|
boolean |
isEmptiable()
Determine if this particle can be empty
|
boolean |
isPointless(ModelGroup container)
Test whether the particle is pointless, as described in XML Schema Part 1
Schema Component Constraint: Particle Valid (Restriction)
|
void |
lookForCycles(Stack references,
SchemaCompiler compiler)
This method is called to look for cycles.
|
void |
serializeParticle(SchemaModelSerializer serializer)
Serialize the particle
|
void |
setReference(ElementDecl declaration)
Set the reference to a specific (typically non-global) element declaration
|
String |
toString() |
boolean |
validate(SchemaCompiler compiler)
Check the validity (consistency) of this element definition.
|
computeParticleCardinality, getComponentAsFunction, getMaxOccurs, getMinOccurs, isVulnerable, markVulnerableSubParticles, setMaxOccurs, setMinOccurs, setVulnerablegetSymbolSpace, getTarget, getTargetComponentName, isDangling, isResolved, setTarget, setTargetComponentName, tryToResolveelaborate, getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, makeXPathExpressionPropertyRecord, saveLocation, setConfiguration, setFixupStatus, setLineNumber, setLocator, setRedefinitionLevel, setSchemaDocumentURI, setSystemId, setValidationStatusclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitelaborategetRedefinitionLevel, getValidationStatusgetConfigurationgetColumnNumber, getLineNumber, getPublicId, getSystemId, saveLocationpublic ElementParticle(EnterpriseConfiguration config, SourceLocator locator)
config - the Configuration to which this element declaration
belongslocator - identifies the location of the element declaration in the
source schema documentpublic ElementParticle copy()
public String getDisplayName()
public String getNamespaceURI()
public String getName()
public ElementDecl getDeclaration() throws MissingComponentException
MissingComponentException - if the reference from the element
particle to the corresponding element declaration has not been resolvedpublic void setReference(ElementDecl declaration)
declaration - the element declaration to which this particle refers.public boolean isEmptiable()
isEmptiable in class Particlepublic boolean isPointless(ModelGroup container)
isPointless in class Particlecontainer - the model group containing this particle; null if there is no containing model grouppublic void lookForCycles(Stack references, SchemaCompiler compiler) throws SchemaException, MissingComponentException
SchemaStructurelookForCycles in interface UserSchemaComponentlookForCycles in class SchemaStructurereferences - A stack 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 compilerSchemaExceptionMissingComponentExceptionpublic boolean fixup(SchemaCompiler compiler) throws SchemaException, MissingComponentException
fixup in interface UserSchemaComponentfixup in class Particlecompiler - is used for reporting errorsSchemaExceptionMissingComponentExceptionpublic boolean validate(SchemaCompiler compiler) throws SchemaException
validate in interface UserSchemaComponentvalidate in class Particlecompiler - the schema compilerSchemaException - if an error is found and the
error listener decides that the error is fatalpublic void compile(SchemaCompiler compiler) throws SchemaException
compile in class Particlecompiler - the schema compilerSchemaException - if compilation fails.public Term getTerm() throws MissingComponentException
getTerm in class ParticleMissingComponentExceptionpublic SchemaType getElementParticleType(StructuredQName elementName)
getElementParticleType in class ParticleelementName - Identifies the name of the child element within this content modelpublic int getElementParticleCardinality(StructuredQName 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.EMPTY.getElementParticleCardinality in class ParticleelementName - Identifies the name of the child element within this content modelMissingComponentExceptionpublic boolean containsElementWildcard()
containsElementWildcard in class Particlepublic void gatherAllPermittedElements(HashSet<StructuredQName> result, boolean ignoreWildcards) throws MissingComponentException
gatherAllPermittedElements in class Particleresult - an initially-empty integer set in which the results are accumulatedignoreWildcards - if true, wildcards are ignored. If false, the result will be
a set containing the value XS_INVALID, meaning that it is not possible to enumerate
all the permitted elementsMissingComponentExceptionpublic void serializeParticle(SchemaModelSerializer serializer) throws XPathException, MissingComponentException
serializeParticle in class Particleserializer - 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-2014 Saxonica Limited. All rights reserved.