public class Element extends Object
| Constructor and Description |
|---|
Element(DTDdocument document)
Constructor, setting owning DTD document of the element.
|
Element(DTDdocument document,
String name)
Constructor, setting the name of the element and owning DTD document.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(Attribute attribute)
Adds attribute to the element.
|
void |
addMixedContentChild(String child)
Adds name of a child to the set of children's names.
|
Enumeration<Attribute> |
getAttributes()
Returns enumeration of the attributes of the element.
|
ContentParticle |
getContent()
Returns
Content Particle, representing the
content of the element, if has ELEMENTS_ONLY content, null otherwise. |
DTDdocument |
getDocument()
Returns DTD document owning this element.
|
Iterator<String> |
getMixedContentChildren()
Returns
iterator of the set of mixed children, if of MIXED
content, null otherwise. |
String |
getName()
Returns the name of the element.
|
boolean |
isAnyContent()
True if the element is of ANY content type, false otherwise.
|
boolean |
isElemOnlyContent()
True if the element is of ELEMENTS_ONLY content type, false otherwise.
|
boolean |
isEmptyContent()
True if the element is of EMPTY content type, false otherwise.
|
boolean |
isMixedContent()
True if the element is of MIXED content type, false otherwise.
|
void |
setAnyContent()
Sets the content type of the element to ANY.
|
void |
setElemOnlyContent(ContentParticle cp)
Sets the content type of the element to ELEMENTS_ONLY.
|
void |
setEmptyContent()
Sets the content type of the element to EMPTY.
|
void |
setMixedContent()
Sets the content type of the element to MIXED.
|
void |
setName(String name)
Sets the name of the element.
|
public Element(DTDdocument document, String name)
document - must not be null.public Element(DTDdocument document)
document - must not be null.public String getName()
public DTDdocument getDocument()
public Iterator<String> getMixedContentChildren()
iterator of the set of mixed children, if of MIXED
content, null otherwise.public Enumeration<Attribute> getAttributes()
public ContentParticle getContent()
Content Particle, representing the
content of the element, if has ELEMENTS_ONLY content, null otherwise.public void setName(String name)
public void setAnyContent()
public boolean isAnyContent()
public void setEmptyContent()
public boolean isEmptyContent()
public void setMixedContent()
public boolean isMixedContent()
public void setElemOnlyContent(ContentParticle cp)
cp - Content Particle representing content of the element.public boolean isElemOnlyContent()
public void addMixedContentChild(String child) throws DTDException
DTDException - if there already exists the child with the same name.public void addAttribute(Attribute attribute)
Copyright © 2016. All rights reserved.