|
SimpleServlets v5.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface HTMLElement
Core unit for HTMLObjects. HTMLElement's are added to other HTMLElement's. Attributes can be added to HTMLElement's.
GenericHTMLElement,
HTMLAttribute| Field Summary | |
|---|---|
static HTMLElement[] |
ZERO_LEN_ARRAY
|
| Method Summary | |
|---|---|
HTMLElement |
add(HTMLElement element)
Add the specified child element to this container. |
HTMLString |
add(String text)
Convenience method to wrap the specified text in an HTMLString
and call add(HTMLElement). |
HTMLElement |
addSibling(HTMLElement element)
Add the specified element to this element's parent. |
HTMLString |
addSibling(String text)
Convenience method to wrap the specified text in an HTMLString
and call addSibling(HTMLElement). |
HTMLAttribute[] |
getAttributes()
Returns an array of all of the attributes. |
HTMLElement[] |
getChildren()
Returns an array of all of the children of this element. |
String |
getName()
Returns the tag name for this element. |
HTMLElement |
getParent()
Returns the current parent element of this element (may be null). |
boolean |
hasAttributes()
Returns true if this element has any attributes set. |
boolean |
hasChildren()
Returns true if there are currently any children nested within this element. |
boolean |
isSafeToWrapWithWhitespace()
Returns true if is is safe to add whitespace before and after this element. |
void |
removeAllAttributes()
Removes all of the attributes. |
void |
removeAllChildren()
Removes all of the children. |
boolean |
removeAttribute(String name)
Attempts to remove the attribute with the specified name. |
boolean |
removeChild(int index)
Attempts to remove the child HTMLElement at the specified index. |
void |
setAttribute(HTMLAttribute attribute)
Sets the specified attribute potentially replacing anything that was previously stored for the same name. |
void |
setAttribute(String name)
Sets the specified attribute potentially replacing anything that was previously stored for the same name. |
void |
setAttribute(String name,
double value)
Sets the specified attribute potentially replacing anything that was previously stored for the same name. |
void |
setAttribute(String name,
int value)
Sets the specified attribute potentially replacing anything that was previously stored for the same name. |
void |
setAttribute(String name,
Object value)
Sets the specified attribute potentially replacing anything that was previously stored for the same name. |
void |
setAttribute(String name,
String value)
Sets the specified attribute potentially replacing anything that was previously stored for the same name. |
void |
setAttribute(String name,
Value value)
Sets the specified attribute potentially replacing anything that was previously stored for the same name. |
void |
setAttributeGroup(HTMLAttribute[] attributeGroup)
Sets ALL the specified attributes potentially replacing anything that was previously stored for the same name(s). |
void |
setParent(HTMLElement parent)
Changes or initially sets the parent element for this element. |
void |
setStyle(String styleName)
Used to add the attribute class with the specified value. |
| Field Detail |
|---|
static final HTMLElement[] ZERO_LEN_ARRAY
| Method Detail |
|---|
String getName()
boolean hasAttributes()
HTMLAttribute[] getAttributes()
void setAttribute(HTMLAttribute attribute)
void setAttribute(String name,
String value)
throws IllegalArgumentException
HTMLAttribute.HTMLAttribute(String, String)).
IllegalArgumentException
void setAttribute(String name,
Value value)
throws IllegalArgumentException
HTMLAttribute.HTMLAttribute(String, Value)).
IllegalArgumentException
void setAttribute(String name,
Object value)
throws IllegalArgumentException
HTMLAttribute.HTMLAttribute(String, Object)).
IllegalArgumentException
void setAttribute(String name,
int value)
throws IllegalArgumentException
HTMLAttribute.HTMLAttribute(String, int)).
IllegalArgumentException
void setAttribute(String name,
double value)
throws IllegalArgumentException
HTMLAttribute.HTMLAttribute(String, double)).
IllegalArgumentException
void setAttribute(String name)
throws IllegalArgumentException
HTMLAttribute.HTMLAttribute(String)).
IllegalArgumentExceptionvoid setAttributeGroup(HTMLAttribute[] attributeGroup)
void setStyle(String styleName)
boolean removeAttribute(String name)
name - the name of the attribute to remove
void removeAllAttributes()
boolean hasChildren()
HTMLElement[] getChildren()
HTMLElement add(HTMLElement element)
element - the element to add.
null is ignored (and returned).
HTMLString add(String text)
HTMLString
and call add(HTMLElement).
Only adds the specified text if it is not null and has a
length greater than 0. The value returned is the HTMLString
created, or null if the passed text was null or zero-length.
HTMLElement addSibling(HTMLElement element)
throws HTMLException
getParent().add(element);
element - the element to add.
null is ignored (and returned).
HTMLException - if there is no parent container at
the moment (if getParent() returns null). This is a
RuntimeException, so callers are not required to
use a try/catch block.
HTMLString addSibling(String text)
throws HTMLException
HTMLString
and call addSibling(HTMLElement).
Only adds the specified text if it is not null and has a
length greater than 0. The value returned is the HTMLString
created, or null if the passed text was null or zero-length.
HTMLException - if there is no parent container at
the moment (if getParent() returns null). This is a
RuntimeException, so callers are not required to
use a try/catch block.boolean removeChild(int index)
getChildren().
index - value from 0 to (getChildren().length - 1)
void removeAllChildren()
void setParent(HTMLElement parent)
HTMLElement getParent()
boolean isSafeToWrapWithWhitespace()
|
SimpleServlets v5.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||