Package org.exolab.castor.xml.schema
Class Particle
java.lang.Object
org.exolab.castor.xml.schema.Structure
org.exolab.castor.xml.schema.Annotated
org.exolab.castor.xml.schema.Particle
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ElementDecl
,Group
,Wildcard
An abstract class that represents an XML Schema Particle This is not an entirely true
representation of how XML Schema depicts a "particle" since this representation of a particle
does not hold the "term" component (element, all, choice, sequence, group, any) but rather the
"term" extends this class.
- Author:
- Keith Visco
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic int
A constant to represent an UNBOUNDED particleFields inherited from class org.exolab.castor.xml.schema.Structure
ANNOTATION, ANYTYPE, APPINFO, ATTRIBUTE, ATTRIBUTE_GROUP, COMPLEX_CONTENT, COMPLEX_TYPE, DOCUMENTATION, ELEMENT, FACET, GROUP, IDENTITY_FIELD, IDENTITY_SELECTOR, KEY, KEYREF, LIST, MODELGROUP, MODELGROUP_REF, REDEFINE, SCHEMA, SIMPLE_CONTENT, SIMPLE_TYPE, UNION, UNIQUE, UNKNOWN, WILDCARD
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Particle()
Default Constructor, uses a default minimum occurance of 1, and a default unbounded maximum occurance -
Method Summary
Modifier and TypeMethodDescriptionfinal int
Returns the maximum number of occurances that this CMParticle may appearfinal int
Returns the minimum number of occurances that this CMParticle must appearboolean
protected final boolean
Indicates whetehr maxOccurs has been set.protected final boolean
Indicates whether minOccurs has been set.final void
setMaxOccurs
(int maxOccurs) Sets the maximum number of occurances that this CMParticle must appear within it's parent contextfinal void
setMinOccurs
(int minOccurs) Sets the minimum number of occurances that this CMParticle must appear within it's parent contextMethods inherited from class org.exolab.castor.xml.schema.Annotated
addAnnotation, getAnnotations, removeAnnotation
Methods inherited from class org.exolab.castor.xml.schema.Structure
getStructureType, isValid, validate
-
Field Details
-
UNBOUNDED
public static int UNBOUNDEDA constant to represent an UNBOUNDED particle
-
-
Constructor Details
-
Particle
protected Particle()Default Constructor, uses a default minimum occurance of 1, and a default unbounded maximum occurance
-
-
Method Details
-
getMaxOccurs
public final int getMaxOccurs()Returns the maximum number of occurances that this CMParticle may appear- Returns:
- the maximum number of occurances that this CMParticle may appear. A non positive (n invalid input: '<' 1) value indicates that the value is unspecified (ie. unbounded).
-
getMinOccurs
public final int getMinOccurs()Returns the minimum number of occurances that this CMParticle must appear- Returns:
- the minimum number of occurances that this CMParticle must appear A negative (n invalid input: '<' 0) value indicates that the value is unspecified.
-
setMaxOccurs
public final void setMaxOccurs(int maxOccurs) Sets the maximum number of occurances that this CMParticle must appear within it's parent context- Parameters:
maxOccurs
- the maximum number of occurances that this CMParticle may appear within it's parent context (-1 for unbounded)
-
setMinOccurs
public final void setMinOccurs(int minOccurs) Sets the minimum number of occurances that this CMParticle must appear within it's parent context- Parameters:
minOccurs
- the number of occurances that this CMParticle must appeae within it's parent context
-
isEmptiable
public boolean isEmptiable()- Returns:
- true if this Particle is emptiable
-
isMaxOccursSet
protected final boolean isMaxOccursSet()Indicates whetehr maxOccurs has been set.- Returns:
- True if maxOccurs has been set.
-
isMinOccursSet
protected final boolean isMinOccursSet()Indicates whether minOccurs has been set.- Returns:
- True if minOccurs has been set.
-