org.exolab.castor.xml.schema

Class Particle

public abstract class Particle extends Annotated

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

Field Summary
static intUNBOUNDED
A constant to represent an UNBOUNDED particle
Constructor Summary
protected Particle()
Default Constructor, uses a default minimum occurance of 1, and a default unbounded maximum occurance
protected Particle(int minOccurs, int maxOccurs)
Constructor for Particle which allows setting the values for maximum and minimum occurances
Method Summary
intgetMaxOccurs()
Returns the maximum number of occurances that this CMParticle may appear
intgetMinOccurs()
Returns the minimum number of occurances that this CMParticle must appear
voidsetMaxOccurs(int maxOccurs)
Sets the maximum number of occurances that this CMParticle must appear within it's parent context
voidsetMinOccurs(int minOccurs)
Sets the minimum number of occurances that this CMParticle must appear within it's parent context

Field Detail

UNBOUNDED

public static int UNBOUNDED
A constant to represent an UNBOUNDED particle

Constructor Detail

Particle

protected Particle()
Default Constructor, uses a default minimum occurance of 1, and a default unbounded maximum occurance

Particle

protected Particle(int minOccurs, int maxOccurs)
Constructor for Particle which allows setting the values for maximum and minimum occurances

Parameters: minOccurs the minimum occurance maxOccurs the maximum occurance ( -1 for unbounded)

Method Detail

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 < 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 < 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

Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com