Package com.saxonica.ee.schema
Class ElementWildcard
- java.lang.Object
-
- com.saxonica.ee.schema.SchemaStructure
-
- com.saxonica.ee.schema.SimpleComponentReference
-
- com.saxonica.ee.schema.Particle
-
- com.saxonica.ee.schema.ElementWildcard
-
- All Implemented Interfaces:
ComponentReference,UserSchemaComponent,javax.xml.transform.SourceLocator,Location,SchemaComponent,org.xml.sax.Locator
public class ElementWildcard extends Particle
This class represents an<any>element in the schema.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.sf.saxon.type.SchemaComponent
SchemaComponent.ValidationStatus
-
-
Field Summary
-
Fields inherited from class com.saxonica.ee.schema.SimpleComponentReference
symbolSpace, target
-
Fields inherited from interface net.sf.saxon.type.SchemaComponent
COMPONENT_FUNCTION_TYPE
-
-
Constructor Summary
Constructors Constructor Description ElementWildcard(EnterpriseConfiguration config)ElementWildcard(Wildcard wc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompile(SchemaCompiler compiler)Compile a particlebooleancontainsElementWildcard()Ask whether the particle contains an element wildcardElementWildcardcopy()booleanfixup(SchemaCompiler compiler)Check references from this component to other componentsvoidgatherAllPermittedElements(IntHashSet result, boolean ignoreWildcards)Find the set of all element particles allowed within the content model of this particle, identified by their integer fingerprints.intgetElementParticleCardinality(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.SchemaTypegetElementParticleType(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.TermgetTerm()Get the term represented by this particleFunctiongetTermComponentAsFunction()WildcardgetWildcard()booleanisEmptiable()Determine if this particle can be emptybooleanisPointless(ModelGroup container)Test whether the particle is pointless, as described in XML Schema Part 1 Schema Component Constraint: Particle Valid (Restriction)voidserializeParticle(SchemaModelSerializer serializer)Serialize the particlevoidsetWildcard(Wildcard wildcard)booleanvalidate(SchemaCompiler compiler)Check the validity (consistency) of this element wildcard definition.-
Methods inherited from class com.saxonica.ee.schema.Particle
computeParticleCardinality, getComponentAsFunction, getMaxOccurs, getMinOccurs, isVulnerable, markVulnerableSubParticles, setMaxOccurs, setMinOccurs, setVulnerable
-
Methods inherited from class com.saxonica.ee.schema.SimpleComponentReference
getSymbolSpace, getTarget, getTargetComponentName, getTargetFingerprint, isDangling, isResolved, setTarget, setTargetComponentName, tryToResolve
-
Methods inherited from class com.saxonica.ee.schema.SchemaStructure
elaborate, getColumnNumber, getConfiguration, getFixupStatus, getGeneratedId, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, hasSameLocation, isValidationNeeded, lookForCycles, makeXPathExpressionPropertyRecord, saveLocation, setConfiguration, setFixupStatus, setGeneratedId, setLineNumber, setLocator, setRedefinitionLevel, setSchemaDocumentURI, setSystemId, setValidationStatus
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.saxonica.ee.schema.ComponentReference
getConfiguration
-
Methods inherited from interface net.sf.saxon.s9api.Location
getColumnNumber, getLineNumber, getPublicId, getSystemId, saveLocation
-
Methods inherited from interface net.sf.saxon.type.SchemaComponent
getRedefinitionLevel, getValidationStatus
-
Methods inherited from interface com.saxonica.ee.schema.UserSchemaComponent
elaborate, lookForCycles
-
-
-
-
Constructor Detail
-
ElementWildcard
public ElementWildcard(EnterpriseConfiguration config)
-
ElementWildcard
public ElementWildcard(Wildcard wc)
-
-
Method Detail
-
copy
public ElementWildcard copy()
-
setWildcard
public void setWildcard(Wildcard wildcard)
-
getWildcard
public Wildcard getWildcard()
-
isEmptiable
public boolean isEmptiable()
Determine if this particle can be empty- Specified by:
isEmptiablein classParticle- Returns:
- true if the particle matches empty content
-
isPointless
public boolean isPointless(ModelGroup container)
Test whether the particle is pointless, as described in XML Schema Part 1 Schema Component Constraint: Particle Valid (Restriction)- Specified by:
isPointlessin classParticle- Parameters:
container- the model group containing this particle; null if there is no containing model group- Returns:
- true if the particle is pointless (for example, a sequence of one item)
-
getTerm
public Term getTerm()
Get the term represented by this particle
-
fixup
public boolean fixup(SchemaCompiler compiler)
Check references from this component to other components- Specified by:
fixupin interfaceUserSchemaComponent- Specified by:
fixupin classParticle- Parameters:
compiler- the schema compiler- Returns:
- true if all is well, false if errors found
-
compile
public void compile(SchemaCompiler compiler)
Description copied from class:ParticleCompile a particle
-
getElementParticleType
public 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. If there is no such particle, return null. If the elementName matches an element wildcard, return the type of the global element declaration with the given name if one exists, or AnyType if none exists and lax validation is permitted by the wildcard.- Specified by:
getElementParticleTypein classParticle- Parameters:
elementName- Identifies the name of the child element within this content model- Returns:
- the type of the element identified by the given name fingerprint. The consistency rule "Element Declarations Consistent" ensures that if there are multiple matching declarations, they have consistent types
-
getElementParticleCardinality
public 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. The value is one ofStaticProperty.EXACTLY_ONE,StaticProperty.ALLOWS_ZERO_OR_ONE,StaticProperty.ALLOWS_ZERO_OR_MORE,StaticProperty.ALLOWS_ONE_OR_MORE, If there is no such particle, returnStaticProperty.ALLOWS_ZERO.- Specified by:
getElementParticleCardinalityin classParticle- Parameters:
elementName- Identifies the name of the child element within this content model- Returns:
- the computed cardinality of this child element within the complex type
-
containsElementWildcard
public boolean containsElementWildcard()
Ask whether the particle contains an element wildcard- Specified by:
containsElementWildcardin classParticle- Returns:
- true if the particle is an element wildcard, or contains one
-
gatherAllPermittedElements
public void gatherAllPermittedElements(IntHashSet result, boolean ignoreWildcards) throws SchemaException
Find the set of all element particles allowed within the content model of this particle, identified by their integer fingerprints.- Specified by:
gatherAllPermittedElementsin classParticle- Parameters:
result- an initially-empty integer set in which the results are accumulatedignoreWildcards- true if wildcards are to be ignored. If false, the value XS_INVALID_NAME is added- Throws:
SchemaException- if an error is found in the schema
-
validate
public boolean validate(SchemaCompiler compiler) throws SchemaException
Check the validity (consistency) of this element wildcard definition.- Specified by:
validatein interfaceUserSchemaComponent- Specified by:
validatein classParticle- Parameters:
compiler- the schema compiler- Returns:
- true if validation succeeded, false if errors were found.
- Throws:
SchemaException- if an error is found and the error listener decides that the error is fatal
-
serializeParticle
public void serializeParticle(SchemaModelSerializer serializer) throws XPathException
Serialize the particle- Specified by:
serializeParticlein classParticle- Parameters:
serializer- the object responsible for serialization- Throws:
XPathException- if writing the serialized form to the destination fails
-
getTermComponentAsFunction
public Function getTermComponentAsFunction()
-
-