|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectcom.saxonica.schema.SchemaStructure
com.saxonica.schema.SimpleComponentReference
com.saxonica.schema.ElementParticle
public class ElementParticle
A reference to an element declaration within the content model of a complex type. This corresponds to an <xs:element ref="x"> element in the XML representation of a schema. Where a local element declaration appears in a content model, using the form <xs:element name="x">, both an element declaration and an element particle are created.
| Constructor Summary | |
|---|---|
ElementParticle(PreparedSchema schema,
SourceLocator locator)
Creates a new element particle |
|
| Method Summary | |
|---|---|
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 |
fixup(SchemaCompiler compiler)
Check references from this component to other components |
void |
gatherAllPermittedElements(IntHashSet result)
Find the set of all element particles allowed within the content model of this particle, identified by their integer fingerprints. |
int |
getComponentTypeCode()
Get a unique number identifying the type of component |
ElementDecl |
getDeclaration()
Returns the ElementDecl that this element definition references. |
String |
getDisplayName()
Returns the display name of this Element particle. |
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 |
getMaxOccurs()
Returns the maximum number of occurrences that this Particle may appear in the containing content model |
int |
getMinOccurs()
Returns the minimum number of occurrences that this Particle must appear in the containing content model |
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(Particle container)
Test whether the particle is pointless, as described in XML Schema Part 1 Schema Component Constraint: Particle Valid (Restriction) |
void |
serialize(SchemaSerializer serializer)
Serialize the schema component |
void |
setMaxOccurs(int maxOccurs)
Sets the maximum number of occurrences for this Particle within the containing content model |
void |
setMinOccurs(int minOccurs)
Sets the minimum number of occurrences for this Particle within the containing content model |
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. |
| Methods inherited from class com.saxonica.schema.SimpleComponentReference |
|---|
getFingerprint, getNameCode, getSymbolSpace, getTarget, isResolved, setNameCode, setTarget, tryToResolve |
| Methods inherited from class com.saxonica.schema.SchemaStructure |
|---|
getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getSystemId, getValidationStatus, lookForCycles, setConfiguration, setFixupStatus, setLineNumber, setLocator, setSystemId, setValidationStatus |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.saxonica.schema.ComponentReference |
|---|
getConfiguration |
| Methods inherited from interface javax.xml.transform.SourceLocator |
|---|
getColumnNumber, getLineNumber, getPublicId, getSystemId |
| Constructor Detail |
|---|
public ElementParticle(PreparedSchema schema,
SourceLocator locator)
schema - the XML Schema to which this element declaration
belongslocator - identifies the location of the element declaration in the
source schema| Method Detail |
|---|
public String getDisplayName()
public String getNamespaceURI()
public String getName()
public ElementDecl getDeclaration()
throws UnresolvedReferenceException
UnresolvedReferenceExceptionpublic void setReference(ElementDecl declaration)
public boolean isEmptiable()
isEmptiable in interface Particlepublic boolean isPointless(Particle container)
isPointless in interface Particle
public boolean fixup(SchemaCompiler compiler)
throws SchemaException,
UnresolvedReferenceException
fixup in interface UserSchemaComponentcompiler - is used for reporting errors
SchemaException
UnresolvedReferenceException
public boolean validate(SchemaCompiler compiler)
throws SchemaException,
ValidationException
validate in interface UserSchemaComponentcompiler -
SchemaException - if an error is found and the
error listener decides that the error is fatal
ValidationException
public void compile(SchemaCompiler compiler)
throws SchemaException,
ValidationException
compile in interface Particlecompiler -
SchemaException - if compilation fails.
ValidationExceptionpublic final int getMaxOccurs()
getMaxOccurs in interface Particlepublic final int getMinOccurs()
getMinOccurs in interface Particlepublic final void setMaxOccurs(int maxOccurs)
maxOccurs - the maximum number of occurrences for this Particle, or -1 to indicate
that the maximum is unboundedpublic final void setMinOccurs(int minOccurs)
setMinOccurs in interface ParticleminOccurs - the minimum number of occurrences for this Particlepublic Term getTerm()
getTerm in interface Particlepublic SchemaType getElementParticleType(int fingerprint)
getElementParticleType in interface Particlefingerprint - Identifies the name of the child element within this content model
public int getElementParticleCardinality(int fingerprint)
throws SchemaException,
ValidationException
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 interface Particlefingerprint - Identifies the name of the child element within this content model
SchemaException
ValidationException
public void gatherAllPermittedElements(IntHashSet result)
throws SchemaException,
ValidationException
gatherAllPermittedElements in interface Particleresult - an initially-empty integer set in which the results are accumulated
SchemaException
ValidationExceptionpublic String toString()
toString in class Object
public void serialize(SchemaSerializer serializer)
throws IOException
serialize in interface SerializableSchemaComponentIOExceptionpublic int getComponentTypeCode()
getComponentTypeCode in interface SerializableSchemaComponent
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||