net.sac.htmlwriter.element
Class Element
java.lang.Object
net.sac.htmlwriter.element.Element
- Direct Known Subclasses:
- A, Body, Br, Div, Head, Html, HtmlFragment, Li, ListElement, P, Script, Style, Table, TableCell, Tbody, TextFragment, Tfoot, Thead, Title, Tr
public abstract class Element
- extends java.lang.Object
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ALLOWED_CHILD_TAGS_NONE
public static final java.lang.String[] ALLOWED_CHILD_TAGS_NONE
ALLOWED_CHILD_TAGS_TEXT_ONLY
public static final java.lang.String[] ALLOWED_CHILD_TAGS_TEXT_ONLY
Element
public Element()
getTagName
public java.lang.String getTagName()
addChild
public void addChild(Element element)
throws HtmlException
- Throws:
HtmlException
insertChild
public void insertChild(Element element,
int index)
throws HtmlException
- Throws:
HtmlException
addAttribute
@Deprecated
public void addAttribute(java.lang.String key,
java.lang.String value)
- Deprecated.
setAttribute
public void setAttribute(java.lang.String key,
java.lang.String value)
getAttribute
public java.lang.String getAttribute(java.lang.String key)
getChildIndex
public int getChildIndex(java.lang.String tagName)
getChild
public Element getChild(java.lang.String tagName,
boolean recursive)
- Return the first child element of this element that has the given element name. If no
element is found, null is returned.
- Parameters:
tagName - tag name of child being searched forrecursive - if true, children of children will be searched recursively
- Returns:
getChildren
public java.util.List<Element> getChildren()
toHtml
public java.lang.String toHtml(boolean formatted,
int depth,
java.lang.String formattingSpacer)