Package org.exolab.castor.xml.dtd
Class Element
- java.lang.Object
-
- org.exolab.castor.xml.dtd.Element
-
public class Element extends java.lang.ObjectImplementation of DTD Element declaration specification.- Version:
- $Revision: 5951 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
- Author:
- Alexander Totok
-
-
Constructor Summary
Constructors Constructor Description Element(DTDdocument document)Constructor, setting owning DTD document of the element.Element(DTDdocument document, java.lang.String name)Constructor, setting the name of the element and owning DTD document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(Attribute attribute)Adds attribute to the element.voidaddMixedContentChild(java.lang.String child)Adds name of a child to the set of children's names.java.util.EnumerationgetAttributes()Returns enumeration of the attributes of the element.ContentParticlegetContent()ReturnsContent Particle, representing the content of the element, if has ELEMENTS_ONLY content, null otherwise.DTDdocumentgetDocument()Returns DTD document owning this element.java.util.IteratorgetMixedContentChildren()Returnsiteratorof the set of mixed children, if of MIXED content, null otherwise.java.lang.StringgetName()Returns the name of the element.booleanisAnyContent()True if the element is of ANY content type, false otherwise.booleanisElemOnlyContent()True if the element is of ELEMENTS_ONLY content type, false otherwise.booleanisEmptyContent()True if the element is of EMPTY content type, false otherwise.booleanisMixedContent()True if the element is of MIXED content type, false otherwise.voidsetAnyContent()Sets the content type of the element to ANY.voidsetElemOnlyContent(ContentParticle cp)Sets the content type of the element to ELEMENTS_ONLY.voidsetEmptyContent()Sets the content type of the element to EMPTY.voidsetMixedContent()Sets the content type of the element to MIXED.voidsetName(java.lang.String name)Sets the name of the element.
-
-
-
Constructor Detail
-
Element
public Element(DTDdocument document, java.lang.String name)
Constructor, setting the name of the element and owning DTD document.- Parameters:
document- must not be null.
-
Element
public Element(DTDdocument document)
Constructor, setting owning DTD document of the element.- Parameters:
document- must not be null.
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of the element.
-
getDocument
public DTDdocument getDocument()
Returns DTD document owning this element.
-
getMixedContentChildren
public java.util.Iterator getMixedContentChildren()
Returnsiteratorof the set of mixed children, if of MIXED content, null otherwise.
-
getAttributes
public java.util.Enumeration getAttributes()
Returns enumeration of the attributes of the element.
-
getContent
public ContentParticle getContent()
ReturnsContent Particle, representing the content of the element, if has ELEMENTS_ONLY content, null otherwise.
-
setName
public void setName(java.lang.String name)
Sets the name of the element.
-
setAnyContent
public void setAnyContent()
Sets the content type of the element to ANY.
-
isAnyContent
public boolean isAnyContent()
True if the element is of ANY content type, false otherwise.
-
setEmptyContent
public void setEmptyContent()
Sets the content type of the element to EMPTY.
-
isEmptyContent
public boolean isEmptyContent()
True if the element is of EMPTY content type, false otherwise.
-
setMixedContent
public void setMixedContent()
Sets the content type of the element to MIXED.
-
isMixedContent
public boolean isMixedContent()
True if the element is of MIXED content type, false otherwise.
-
setElemOnlyContent
public void setElemOnlyContent(ContentParticle cp)
Sets the content type of the element to ELEMENTS_ONLY.- Parameters:
cp- Content Particle representing content of the element.
-
isElemOnlyContent
public boolean isElemOnlyContent()
True if the element is of ELEMENTS_ONLY content type, false otherwise.
-
addMixedContentChild
public void addMixedContentChild(java.lang.String child) throws DTDExceptionAdds name of a child to the set of children's names.- Throws:
DTDException- if there already exists the child with the same name.
-
addAttribute
public void addAttribute(Attribute attribute)
Adds attribute to the element. If the element already has the attribute with the same name, does nothing.
-
-