Package org.exolab.castor.xml.dtd
Class ContentParticle
java.lang.Object
org.exolab.castor.xml.dtd.ContentParticle
Implementation of DTD Content Particle specification, used to define the content of an element.
- Version:
- $Revision$ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar 2003) $
- Author:
- Alexander Totok
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor, 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
Modifier and TypeMethodDescriptionvoid
Adds child to the vector of child elements (content particles).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.Returns the name of the child element, if content is exactly one child.boolean
True if the content is a choice list of content particles, false otherwise.boolean
True if ocurence specification of the content particle is ONE, false otherwise.boolean
True if occurance specification of the content particle is ONE_OR_MORE, false otherwise.boolean
True if the content is exactly on child-element, false otherwise.boolean
True if the content is a sequence list of content particles, false otherwise.boolean
True if occurance specification of the content particle is ZERO_OR_MORE, false otherwise.boolean
True if occurance specification of the content particle is ZERO_OR_ONE, false otherwise.void
Sets the content to choice list of content particles.void
Sets occurance specification of the content particle to ONE.void
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
Sets the content to sequence list of content particles.void
Sets occurance specification of the content particle to ZERO_OR_MORE.void
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
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
-
setReferenceType
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.
-
isReferenceType
public boolean isReferenceType()True if the content is exactly on child-element, false otherwise. -
setSeqType
public void setSeqType()Sets the content to sequence list of content particles. -
isSeqType
public boolean isSeqType()True if the content is a sequence list of content particles, false otherwise. -
setChoiceType
public void setChoiceType()Sets the content to choice list of content particles. -
isChoiceType
public boolean isChoiceType()True if the content is a choice list of content particles, false otherwise. -
getReference
Returns the name of the child element, if content is exactly one child. -
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. -
setOneOccurance
public void setOneOccurance()Sets occurance specification of the content particle to ONE. -
isOneOccurance
public boolean isOneOccurance()True if ocurence specification of the content particle is ONE, false otherwise. -
setZeroOrOneOccurance
public void setZeroOrOneOccurance()Sets occurance specification of the content particle to ZERO_OR_ONE. -
isZeroOrOneOccurance
public boolean isZeroOrOneOccurance()True if occurance specification of the content particle is ZERO_OR_ONE, false otherwise. -
setOneOrMoreOccurances
public void setOneOrMoreOccurances()Sets occurance specification of the content particle to ONE_OR_MORE. -
isOneOrMoreOccurances
public boolean isOneOrMoreOccurances()True if occurance specification of the content particle is ONE_OR_MORE, false otherwise. -
setZeroOrMoreOccurances
public void setZeroOrMoreOccurances()Sets occurance specification of the content particle to ZERO_OR_MORE. -
isZeroOrMoreOccurances
public boolean isZeroOrMoreOccurances()True if occurance specification of the content particle is ZERO_OR_MORE, false otherwise. -
addChild
Adds child to the vector of child elements (content particles).- Parameters:
cp
- content particle to add to the vector of children.
-