public abstract class Element extends Object
MessageMLContext.| Modifier and Type | Field and Description |
|---|---|
static String |
CLASS_ATTR |
protected FormatEnum |
format |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(Element child)
Append a child to the element.
|
String |
asText()
Return a text representation of the element, descending into its children.
|
void |
buildAll(MessageMLParser context,
Element element)
Process a DOM element, descending into its children, and construct the output MessageML tree.
|
List<Element> |
findElements(Class type)
Search the MessageML tree (depth-first) for elements of a given type.
|
List<Element> |
findElements(String tag)
Search the MessageML tree (depth-first) for elements with a given MessageML tag.
|
List<Element> |
findElements(String attribute,
String value)
Search the MessageML tree (depth-first) for elements with a given attribute-value pair.
|
String |
getAttribute(String attr)
Return the value of the element's attribute "attr".
|
Map<String,String> |
getAttributes()
Return a map of the element's attributes.
|
Element |
getChild(int n)
Return the nth child of the element.
|
List<Element> |
getChildren()
Return a list of the element's children.
|
FormatEnum |
getFormat()
Return the format (MessageML or PresentationML) of the element.
|
String |
getMessageMLTag()
Return the element's MessageML tag.
|
Element |
getParent()
Return the parent of the element.
|
int |
size()
Return the number of children of the element.
|
public static final String CLASS_ATTR
protected FormatEnum format
public void buildAll(MessageMLParser context, Element element) throws InvalidInputException, ProcessingException
public String asText()
public String getMessageMLTag()
public String getAttribute(String attr)
public Element getChild(int n)
public void addChild(Element child)
public int size()
public Element getParent()
public FormatEnum getFormat()
public List<Element> findElements(Class type)
type - the class of elements to findpublic List<Element> findElements(String tag)
tag - the MessageML tag of elements to findCopyright © 2017 The Symphony Software Foundation. All rights reserved.