|
|||||||
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.AbstractParticle
com.saxonica.schema.GroupReference
public class GroupReference
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 GroupReference 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 Compositor
class to give a view of the content model in which the
group references disappear.
Field Summary |
---|
Fields inherited from class com.saxonica.schema.AbstractParticle |
---|
UNBOUNDED |
Fields inherited from interface net.sf.saxon.type.SchemaComponent |
---|
FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING |
Fields inherited from interface com.saxonica.schema.SerializableSchemaComponent |
---|
ALL_COMPOSITOR, ATOMIC_TYPE, ATTRIBUTE_DECL, ATTRIBUTE_GROUP, ATTRIBUTE_GROUP_REF, ATTRIBUTE_USE, ATTRIBUTE_WILDCARD, CHOICE_COMPOSITOR, COMPLEX_TYPE, ELEMENT_DECL, ELEMENT_PARTICLE, ELEMENT_WILDCARD, FACET, KEY, KEYREF, LIST_TYPE, MODEL_GROUP, MODEL_GROUP_REF, NOTATION, SEQUENCE_COMPOSITOR, UNION_TYPE, UNIQUE |
Constructor Summary | |
---|---|
GroupReference(PreparedSchema schema,
SourceLocator locator)
Creates a new Group definition |
Method Summary | |
---|---|
void |
compile(SchemaCompiler compiler)
Compile a particle |
boolean |
fixup(SchemaCompiler compiler)
Fix up references to other elements in the schema. |
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 |
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 |
getFingerprint()
Get the fingerprint of the target of this reference |
ModelGroupDefinition |
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 |
isResolved()
Determine whether this reference has been resolved |
void |
lookForCycles(Stack references,
SchemaCompiler compiler)
This method is called to look for cycles. |
void |
serialize(SchemaSerializer serializer)
Serialize the schema component |
void |
setFingerprint(int fingerprint)
|
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.AbstractParticle |
---|
computeParticleCardinality, getMaxOccurs, getMinOccurs, isPointless, setMaxOccurs, setMinOccurs |
Methods inherited from class com.saxonica.schema.SchemaStructure |
---|
getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getSystemId, getValidationStatus, setConfiguration, setFixupStatus, setLineNumber, setLocator, setSystemId, setValidationStatus |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.saxonica.schema.ComponentReference |
---|
getConfiguration |
Methods inherited from interface javax.xml.transform.SourceLocator |
---|
getColumnNumber, getLineNumber, getPublicId, getSystemId |
Methods inherited from interface net.sf.saxon.type.SchemaComponent |
---|
getValidationStatus |
Constructor Detail |
---|
public GroupReference(PreparedSchema schema, SourceLocator locator)
schema
- the XML Schema to which this Group
belongsMethod Detail |
---|
public boolean isResolved()
isResolved
in interface ComponentReference
public ModelGroupDefinition getGroup() throws UnresolvedReferenceException
UnresolvedReferenceException
public void setFingerprint(int fingerprint)
public int getFingerprint()
ComponentReference
getFingerprint
in interface ComponentReference
public int getSymbolSpace()
getSymbolSpace
in interface ComponentReference
public boolean isEmptiable() throws UnresolvedReferenceException
isEmptiable
in interface Particle
UnresolvedReferenceException
public boolean fixup(SchemaCompiler compiler) throws SchemaException
fixup
in interface UserSchemaComponent
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
UnresolvedReferenceException
- if the reference has not been resolved. Note that
this is an unchecked exception.public void tryToResolve(SchemaCompiler compiler)
tryToResolve
in interface ComponentReference
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 SchemaType getElementParticleType(int fingerprint)
getElementParticleType
in interface Particle
fingerprint
- Identifies the name of the child element within this content modelpublic 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 Particle
fingerprint
- Identifies the name of the child element within this content model
SchemaException
ValidationException
public void gatherAllPermittedElements(IntHashSet result) throws SchemaException, ValidationException
gatherAllPermittedElements
in interface Particle
result
- an initially-empty integer set in which the results are accumulated
SchemaException
ValidationException
public boolean validate(SchemaCompiler compiler) throws SchemaException, ValidationException
validate
in interface UserSchemaComponent
SchemaException
ValidationException
public void compile(SchemaCompiler compiler) throws SchemaException, ValidationException
compile
in interface Particle
compiler
-
SchemaException
ValidationException
public Term getTerm()
getTerm
in interface Particle
getTerm
in class AbstractParticle
public void serialize(SchemaSerializer serializer) throws IOException
serialize
in interface SerializableSchemaComponent
IOException
public int getComponentTypeCode()
getComponentTypeCode
in interface SerializableSchemaComponent
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |