com.saxonica.schema
Class AbstractParticle

java.lang.Object
  extended bycom.saxonica.schema.SchemaStructure
      extended bycom.saxonica.schema.AbstractParticle
All Implemented Interfaces:
Particle, SchemaComponent, java.io.Serializable, javax.xml.transform.SourceLocator, UserSchemaComponent
Direct Known Subclasses:
Compositor, GroupReference

public abstract class AbstractParticle
extends SchemaStructure
implements Particle

An abstract class that implements an XML Schema Particle.

Note that not all Particles belong to this class. In particular, Element Wildcards are particles, but they are not instances of AbstractParticle: this is because it is more convenient for them to share implementation details with Attribute Wildcards. To refer generically to Particles, use the Particle interface.

See Also:
Serialized Form

Field Summary
static int UNBOUNDED
          A constant to represent an UNBOUNDED number of occurrences
 
Fields inherited from interface net.sf.saxon.type.SchemaComponent
FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING
 
Constructor Summary
protected AbstractParticle()
          Default Constructor, uses a default minimum occurrence of 1, and a default unbounded maximum occurrence
 
Method Summary
 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
abstract  Term getTerm()
          Get the term corresponding to this particle
 void rewrite()
          Rewrite a particle prior to compiling it
 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
 
Methods inherited from class com.saxonica.schema.SchemaStructure
getColumnNumber, getFixupStatus, getLineNumber, getPublicId, getSchema, getSystemId, getValidationStatus, lookForCycles, setFixupStatus, setLineNumber, setLocator, setSchema, 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.schema.Particle
compile, getElementParticleCardinality, getElementParticleType, isEmptiable
 
Methods inherited from interface com.saxonica.schema.UserSchemaComponent
fixup, lookForCycles, validate
 
Methods inherited from interface net.sf.saxon.type.SchemaComponent
getValidationStatus
 

Field Detail

UNBOUNDED

public static int UNBOUNDED
A constant to represent an UNBOUNDED number of occurrences

Constructor Detail

AbstractParticle

protected AbstractParticle()
Default Constructor, uses a default minimum occurrence of 1, and a default unbounded maximum occurrence

Method Detail

getMaxOccurs

public final int getMaxOccurs()
Returns the maximum number of occurrences that this Particle may appear in the containing content model

Specified by:
getMaxOccurs in interface Particle
Returns:
the maximum number of occurrences that this Particle may appear. A negative (n < 0) value indicates that the value is unspecified (ie. unbounded).

getMinOccurs

public final int getMinOccurs()
Returns the minimum number of occurrences that this Particle must appear in the containing content model

Specified by:
getMinOccurs in interface Particle
Returns:
the minimum number of occurrences that this Particle must appear A negative (n < 0) value indicates that the value is unspecified.

setMaxOccurs

public final void setMaxOccurs(int maxOccurs)
Sets the maximum number of occurrences for this Particle within the containing content model

Parameters:
maxOccurs - the maximum number of occurrences for this Particle, or -1 to indicate that the maximum is unbounded

setMinOccurs

public final void setMinOccurs(int minOccurs)
Sets the minimum number of occurrences for this Particle within the containing content model

Specified by:
setMinOccurs in interface Particle
Parameters:
minOccurs - the minimum number of occurrences for this Particle

getTerm

public abstract Term getTerm()
Get the term corresponding to this particle

Specified by:
getTerm in interface Particle
Returns:
the corresponding term

rewrite

public void rewrite()
Rewrite a particle prior to compiling it

Specified by:
rewrite in interface Particle