org.exolab.castor.xml.dtd

Class ContentParticle


public class ContentParticle
extends java.lang.Object

Implementation of DTD Content Particle specification, used to define the content of an element.
Version:
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:09:19 $
Author:
Alexander Totok

Constructor Summary

ContentParticle()
Constructor, setting occurance specification to ONE, by default.
ContentParticle(String reference)
Creates content particle and sets its type to REFERENCE, that is the content is exactly one child-element.

Method Summary

void
addChild(ContentParticle cp)
Adds child to the vector of child elements (content particles).
Enumeration
getChildren()
Returns enumeration of the children - content particles, that form the content of this Content Particle, if has SEQ or CHOICE type (sequence or choice list), null otherwise.
String
getReference()
Returns the name of the child element, if content is exactly one child.
boolean
isChoiceType()
True if the content is a choice list of content particles, false otherwise.
boolean
isOneOccurance()
True if ocurence specification of the content particle is ONE, false otherwise.
boolean
isOneOrMoreOccurances()
True if occurance specification of the content particle is ONE_OR_MORE, false otherwise.
boolean
isReferenceType()
True if the content is exactly on child-element, false otherwise.
boolean
isSeqType()
True if the content is a sequence list of content particles, false otherwise.
boolean
isZeroOrMoreOccurances()
True if occurance specification of the content particle is ZERO_OR_MORE, false otherwise.
boolean
isZeroOrOneOccurance()
True if occurance specification of the content particle is ZERO_OR_ONE, false otherwise.
void
setChoiceType()
Sets the content to choice list of content particles.
void
setOneOccurance()
Sets occurance specification of the content particle to ONE.
void
setOneOrMoreOccurances()
Sets occurance specification of the content particle to ONE_OR_MORE.
void
setReferenceType(String reference)
Makes the content particle represent the content with exactly one child-element.
void
setSeqType()
Sets the content to sequence list of content particles.
void
setZeroOrMoreOccurances()
Sets occurance specification of the content particle to ZERO_OR_MORE.
void
setZeroOrOneOccurance()
Sets occurance specification of the content particle to ZERO_OR_ONE.

Constructor Details

ContentParticle

public ContentParticle()
Constructor, setting occurance specification to ONE, by default.

ContentParticle

public ContentParticle(String reference)
Creates content particle and sets its type to REFERENCE, that is the content is exactly one child-element.
Parameters:
reference - name of this child-element.

Method Details

addChild

public void addChild(ContentParticle cp)
Adds child to the vector of child elements (content particles).
Parameters:
cp - content particle to add to the vector of children.

getChildren

public Enumeration getChildren()
Returns enumeration of the children - content particles, that form the content of this Content Particle, if has SEQ or CHOICE type (sequence or choice list), null otherwise.

getReference

public String getReference()
Returns the name of the child element, if content is exactly one child.

isChoiceType

public boolean isChoiceType()
True if the content is a choice list of content particles, false otherwise.

isOneOccurance

public boolean isOneOccurance()
True if ocurence specification of the content particle is ONE, false otherwise.

isOneOrMoreOccurances

public boolean isOneOrMoreOccurances()
True if occurance specification of the content particle is ONE_OR_MORE, false otherwise.

isReferenceType

public boolean isReferenceType()
True if the content is exactly on child-element, false otherwise.

isSeqType

public boolean isSeqType()
True if the content is a sequence list of content particles, false otherwise.

isZeroOrMoreOccurances

public boolean isZeroOrMoreOccurances()
True if occurance specification of the content particle is ZERO_OR_MORE, false otherwise.

isZeroOrOneOccurance

public boolean isZeroOrOneOccurance()
True if occurance specification of the content particle is ZERO_OR_ONE, false otherwise.

setChoiceType

public void setChoiceType()
Sets the content to choice list of content particles.

setOneOccurance

public void setOneOccurance()
Sets occurance specification of the content particle to ONE.

setOneOrMoreOccurances

public void setOneOrMoreOccurances()
Sets occurance specification of the content particle to ONE_OR_MORE.

setReferenceType

public void setReferenceType(String reference)
Makes the content particle represent the content with exactly one child-element.
Parameters:
reference - the name of this child-element - must not be null or equal to empty String.

setSeqType

public void setSeqType()
Sets the content to sequence list of content particles.

setZeroOrMoreOccurances

public void setZeroOrMoreOccurances()
Sets occurance specification of the content particle to ZERO_OR_MORE.

setZeroOrOneOccurance

public void setZeroOrOneOccurance()
Sets occurance specification of the content particle to ZERO_OR_ONE.

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