Package com.saxonica.ee.schema
Class ChoiceModelGroup
- java.lang.Object
-
- com.saxonica.ee.schema.SchemaStructure
-
- com.saxonica.ee.schema.ModelGroup
-
- com.saxonica.ee.schema.ChoiceModelGroup
-
- All Implemented Interfaces:
Term,UserSchemaComponent,javax.xml.transform.SourceLocator,Location,SchemaComponent,org.xml.sax.Locator
public class ChoiceModelGroup extends ModelGroup
A ChoiceCompositor represents an xs:choice 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.ModelGroup
contentModel, simplifiedContentModel
-
Fields inherited from interface net.sf.saxon.type.SchemaComponent
COMPONENT_FUNCTION_TYPE
-
-
Constructor Summary
Constructors Constructor Description ChoiceModelGroup()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetCompositorName()Get the name of this compositorbooleanisEmptiable()Determine if empty content is allowedbooleanisPointless(ModelGroup container)Test whether the compositor is pointless, as described in XML Schema Part 1 Schema Component Constraint: Particle Valid (Restriction)voidmarkVulnerableSubParticles(boolean isRepeatable)Mark contained particles as vulnerable.booleanvalidate(SchemaCompiler compiler)Checks the validity of this Compositor definition.-
Methods inherited from class com.saxonica.ee.schema.ModelGroup
addParticle, checkElements, compile, containsAll, containsElementWildcard, fixup, gatherAllPermittedElements, getComponentAsFunction, getContentModelSize, getElementParticleCardinality, getElementParticleType, getParticles, getSimplifiedContentModel, getTerm, isEmpty, lookForCycles, serialize, setContentModel
-
Methods inherited from class com.saxonica.ee.schema.SchemaStructure
elaborate, getColumnNumber, getConfiguration, getFixupStatus, getGeneratedId, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, hasSameLocation, isValidationNeeded, 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 net.sf.saxon.type.SchemaComponent
getRedefinitionLevel, getValidationStatus
-
Methods inherited from interface com.saxonica.ee.schema.UserSchemaComponent
elaborate
-
-
-
-
Method Detail
-
isEmptiable
public boolean isEmptiable() throws MissingComponentExceptionDetermine if empty content is allowed- Specified by:
isEmptiablein classModelGroup- Returns:
- true if empty content matches this compositor, which is true if the compositor as a whole has minOccurs=0, or if any of the choices allows empty content.
- Throws:
MissingComponentException- if the schema contains unresolved references to required components
-
isPointless
public boolean isPointless(ModelGroup container)
Test whether the compositor is pointless, as described in XML Schema Part 1 Schema Component Constraint: Particle Valid (Restriction)- Overrides:
isPointlessin classModelGroup- Parameters:
container- not used- Returns:
- true if the particle is pointless (which effectively means it can't match anything)
-
markVulnerableSubParticles
public void markVulnerableSubParticles(boolean isRepeatable) throws MissingComponentExceptionMark contained particles as vulnerable. A particle is marked as vulnerable if everything both before and after it in the content model is optional. This contributes to the algorithm for deciding whether counting states can be used for this particle in the finite state machine- Overrides:
markVulnerableSubParticlesin classModelGroup- Parameters:
isRepeatable- set to true if this part of the content model can be repeated- Throws:
MissingComponentException
-
validate
public boolean validate(SchemaCompiler compiler) throws SchemaException
Checks the validity of this Compositor definition.- Specified by:
validatein interfaceUserSchemaComponent- Overrides:
validatein classModelGroup- Returns:
- true when this Schema definition is valid, otherwise false.
- Throws:
SchemaException- when the error listener decides an error is fatal
-
getCompositorName
public java.lang.String getCompositorName()
Get the name of this compositor- Specified by:
getCompositorNamein classModelGroup- Returns:
- one of "sequence", "choice", or "all"
-
-