## com.saxonica.schema
Class AllModelGroup

    java.lang.Object
      com.saxonica.schema.SchemaStructure
          com.saxonica.schema.ModelGroup
              com.saxonica.schema.AllModelGroup

All Implemented Interfaces:
  Term, UserSchemaComponent, java.io.Serializable, javax.xml.transform.SourceLocator, SchemaComponent

    public class AllModelGroup

extends ModelGroup

An AllModelGroup represents an xs:all element in the schema

See Also:
  Serialized Form

Field Summary

Fields inherited from class com.saxonica.schema.ModelGroup
`contentModel`

Fields inherited from interface net.sf.saxon.type.SchemaComponent
`FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING`

Constructor Summary
`AllModelGroup()` Create an AllModelGroup

Method Summary
`void` `addParticle(Particle particle)` Adds a given Particle to the content model defined by this Compositor
`protected static java.lang.String` `allSubsumes(UserComplexType base, ComplexType sub, SchemaCompiler compiler)` Test whether a complex type constructed using "all" subsumes another complex type.
`protected boolean` `checkElements(IntHashMap map, SchemaCompiler compiler)` Check that the elements defined as particles in this compositor are consistent (overrides method on parent class Compositor)
`boolean` `containsAll(boolean simplified)` Determine if the content model uses xs:all.
`void` `elaborate(SchemaCompiler compiler)` Elaborate the schema component: after reloading a serialized schema component model, this expands the component with derived information needed during validation episodes.
`java.lang.String` `getCompositorName()` Get the name of this compositor
`IntToIntMap` `getCounterMap()` Get a mapping from element name fingerprints (including fingerprints of substitution group members) to entries in the minima and maxima arrays.
`IntHashMap` `getDeclarationMap()` Get a mapping from element name fingerprints (including fingerprints of substitution group members) to local or global element declarations to be used to validate the content of each element in the all group
`int[]` `getMaxima()` Get the values of maxOccurs() for all the particles, as an array
`int[]` `getMinima()` Get the values of minOccurs() for all the particles, as an array
`int[]` `getNameCodes()` Get the namecodes of the element particles corresponding to each item in the maxima/minima arrays.
`java.util.List` `getWildcards()` Get the list of element wildcards (XSDL 1.1 only)
`boolean` `isEmptiable()` Determine if empty content is allowed
`boolean` `isEmpty()` Return true if the content model is empty
`boolean` `isPointless(ModelGroup container)` Test whether the compositor is pointless, as described in XML Schema Part 1 Schema Component Constraint: Particle Valid (Restriction)
`java.util.Iterator` `iterateParticles()` Iterate over the Particles of the content model defined by this Compositor.
`boolean` `validate(SchemaCompiler compiler)` Checks the validity of this Compositor definition.

Methods inherited from class com.saxonica.schema.ModelGroup
`compile, fixup, gatherAllPermittedElements, getContentModelSize, getElementParticleCardinality, getElementParticleType, getListOfParticles, getSimplifiedContentModel, getTerm, lookForCycles, markVulnerableSubParticles, serialize, setContentModel`

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
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface net.sf.saxon.type.SchemaComponent
`getValidationStatus`

Constructor Detail

### AllModelGroup

    public AllModelGroup()

  Create an AllModelGroup

Method Detail

### addParticle

    public void addParticle(Particle particle)

  Adds a given Particle to the content model defined by this Compositor

  Overrides:
    `addParticle` in class `ModelGroup`
  Parameters:
    `particle` - the Particle to be added

### iterateParticles

    public java.util.Iterator iterateParticles()

  Iterate over the Particles of the content model defined by this Compositor.

  Overrides:
    `iterateParticles` in class `ModelGroup`
  Returns:
    an iterator over the immediately contained particles in the content model defined by this Compositor. Note that the iteration may return group references as well as "true" particles.

### containsAll

    public boolean containsAll(boolean simplified)

  Determine if the content model uses xs:all.

  Overrides:
    `containsAll` in class `ModelGroup`
  Parameters:
    `simplified` - set to false if we want to look at the original unsimplified content model, to true if we want the model after removing pointless particles
  Returns:
    true (always)

### isEmpty

    public boolean isEmpty()

  Return true if the content model is empty

  Overrides:
    `isEmpty` in class `ModelGroup`
  Returns:
    true if the content model is empty

### isEmptiable

    public boolean isEmptiable()
                        throws UnresolvedReferenceException

  Determine if empty content is allowed

  Specified by:
    `isEmptiable` in class `ModelGroup`
  Returns:
    true if this content model permits empty content
  Throws:
    `UnresolvedReferenceException`

### 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:
    `isPointless` in class `ModelGroup`
  Parameters:
    `container` - not used
  Returns:
    true if the particle is pointless (which effectively means it can't match anything)

### checkElements

    protected boolean checkElements(IntHashMap map,
                                    SchemaCompiler compiler)
                             throws SchemaException,
                                    UnresolvedReferenceException

  Check that the elements defined as particles in this compositor are consistent (overrides method on parent class Compositor)

  Overrides:
    `checkElements` in class `ModelGroup`
  Parameters:
    `map` - a HashMap that maps integers to ElementDecl's
    `compiler` - used for error reporting
  Returns:
    true of the elements are consistent
  Throws:
    `SchemaException`
    `UnresolvedReferenceException`

### getCompositorName

    public java.lang.String getCompositorName()

  Get the name of this compositor

  Specified by:
    `getCompositorName` in class `ModelGroup`
  Returns:
    one of "sequence", "choice", or "all"

### validate

    public boolean validate(SchemaCompiler compiler)
                     throws SchemaException

  Checks the validity of this Compositor definition.

  Specified by:
    `validate` in interface `UserSchemaComponent`
  Overrides:
    `validate` in class `ModelGroup`
  Returns:
    true when this Schema definition is valid, otherwise false.
  Throws:
    `SchemaException` - when the error listener decides an error is fatal

### elaborate

    public void elaborate(SchemaCompiler compiler)
                   throws SchemaException

  Elaborate the schema component: after reloading a serialized schema component model, this expands the component with derived information needed during validation episodes. The model is assumed to be valid.

  Specified by:
    `elaborate` in interface `UserSchemaComponent`
  Overrides:
    `elaborate` in class `SchemaStructure`
  Parameters:
    `compiler` -
  Throws:
    `SchemaException`

### getMaxima

    public int[] getMaxima()

  Get the values of maxOccurs() for all the particles, as an array

  Returns:
    an array containing the maxOccurs() values. The value "unbounded" is represented as -1. The entry in the array for a given element name can be found using the counterMap.

### getMinima

    public int[] getMinima()

  Get the values of minOccurs() for all the particles, as an array

  Returns:
    an array containing the minOccurs() values. The entry in the array for a given element name can be found using the counterMap.

### getNameCodes

    public int[] getNameCodes()

  Get the namecodes of the element particles corresponding to each item in the maxima/minima arrays.

  Returns:
    an array containing the nameCode values.

### getCounterMap

    public IntToIntMap getCounterMap()

  Get a mapping from element name fingerprints (including fingerprints of substitution group members) to entries in the minima and maxima arrays. Note that this includes entries for all members of substitution groups, so several fingeprints map to the same counter position

  Returns:
    a map from element fingerprints to counter positions

### getDeclarationMap

    public IntHashMap getDeclarationMap()

  Get a mapping from element name fingerprints (including fingerprints of substitution group members) to local or global element declarations to be used to validate the content of each element in the all group

  Returns:
    a map from element name fingerprints to element declarations

### getWildcards

    public java.util.List getWildcards()

  Get the list of element wildcards (XSDL 1.1 only)

  Returns:
    a list holding the element wildcards defined in this model group, or an empty list if there are none

### allSubsumes

    protected static java.lang.String allSubsumes(UserComplexType base,
                                                  ComplexType sub,
                                                  SchemaCompiler compiler)
                                           throws SchemaException

  Test whether a complex type constructed using "all" subsumes another complex type. This test is always done after simplification of the content model

  Parameters:
    `base` - the base type, which must be defined using xs:all
    `sub` - the particle that is (supposedly) subsumed by the base type
    `compiler` - used for reporting errors and warnings
  Returns:
    null if the "all" particle subsumes the other; otherwise, a string explaining why not. If the string starts with "?", this means Saxon is unable to prove one way or the other whether the derived type is a valid restriction or not.
  Throws:
    `SchemaException`

Copyright (c) Saxonica Limited. All rights reserved.