com.sun.lwuit.html
Class HTMLElement

java.lang.Object
  extended by com.sun.lwuit.xml.Element
      extended by com.sun.lwuit.html.HTMLElement

public class HTMLElement
extends Element

The HTMLElement class defines a single HTML element with its attributes and children. Due to its hierarchial nature, this class can be used for a single "leaf" Element, for more complex elements (with child elements), and up to describing the entire document.


Field Summary
static int ATTR_ABBR
           
static int ATTR_ACCESSKEY
           
static int ATTR_ACTION
           
static int ATTR_ALIGN
           
static int ATTR_ALT
           
static int ATTR_AXIS
           
static int ATTR_BGCOLOR
           
static int ATTR_BORDER
           
static int ATTR_CELLPADDING
           
static int ATTR_CELLSPACING
           
static int ATTR_CHARSET
           
static int ATTR_CHECKED
           
static int ATTR_CITE
           
static int ATTR_CLASS
           
static int ATTR_COLOR
           
static int ATTR_COLS
           
static int ATTR_COLSPAN
           
static int ATTR_CONTENT
           
static int ATTR_COORDS
           
static int ATTR_DIR
           
static int ATTR_DISABLED
           
static int ATTR_EMPTYOK
           
static int ATTR_ENCTYPE
           
static int ATTR_FACE
           
static int ATTR_FOR
           
static int ATTR_FORMAT
           
static int ATTR_FRAME
           
static int ATTR_HEADERS
           
static int ATTR_HEIGHT
           
static int ATTR_HREF
           
static int ATTR_HREFLANG
           
static int ATTR_HSPACE
           
static int ATTR_HTTPEQUIV
           
static int ATTR_ID
           
static int ATTR_ISMAP
           
static int ATTR_ISTYLE
           
static int ATTR_LABEL
           
static int ATTR_LANG
           
static int ATTR_LINK
           
static int ATTR_LOCALSRC
           
static int ATTR_LONGDESC
           
static int ATTR_MAXLENGTH
           
static int ATTR_MEDIA
           
static int ATTR_METHOD
           
static int ATTR_MULTIPLE
           
static int ATTR_NAME
           
static int ATTR_READONLY
           
static int ATTR_REL
           
static int ATTR_REV
           
static int ATTR_ROWS
           
static int ATTR_ROWSPAN
           
static int ATTR_RULES
           
static int ATTR_SCHEME
           
static int ATTR_SCOPE
           
static int ATTR_SELECTED
           
static int ATTR_SHAPE
           
static int ATTR_SIZE
           
static int ATTR_SRC
           
static int ATTR_START
           
static int ATTR_STYLE
           
static int ATTR_SUMMARY
           
static int ATTR_TABINDEX
           
static int ATTR_TEXT
           
static int ATTR_TITLE
           
static int ATTR_TYPE
           
static int ATTR_USEMAP
           
static int ATTR_VALIGN
           
static int ATTR_VALUE
           
static int ATTR_VERSION
           
static int ATTR_WIDTH
           
static int ATTR_VSPACE
           
static int ATTR_XMLLANG
           
static int ATTR_XMLNS
           
static int ATTR_XMLSPACE
           
static int COLOR_AQUA
           
static int COLOR_BLACK
           
static int COLOR_BLUE
           
static int COLOR_FUCHSIA
           
static int COLOR_GRAY
           
static int COLOR_GREEN
           
static int COLOR_LIME
           
static int COLOR_MAROON
           
static int COLOR_NAVY
           
static int COLOR_OLIVE
           
static int COLOR_ORANGE
           
static int COLOR_PURPLE
           
static int COLOR_RED
           
static int COLOR_SILVER
           
static int COLOR_TEAL
           
static int COLOR_WHITE
           
static int COLOR_YELLOW
           
static int TAG_A
           
static int TAG_ABBR
           
static int TAG_ACRONYM
           
static int TAG_ADDRESS
           
static int TAG_AREA
           
static int TAG_B
           
static int TAG_BASE
           
static int TAG_BASEFONT
           
static int TAG_BIG
           
static int TAG_BLOCKQUOTE
           
static int TAG_BODY
           
static int TAG_BR
           
static int TAG_CAPTION
           
static int TAG_CENTER
           
static int TAG_CITE
           
static int TAG_CODE
           
static int TAG_CSS_ILLEGAL_SELECTOR
           
static int TAG_CSS_SELECTOR
           
static int TAG_DD
           
static int TAG_DEL
           
static int TAG_DFN
           
static int TAG_DIR
           
static int TAG_DIV
           
static int TAG_DL
           
static int TAG_DT
           
static int TAG_EM
           
static int TAG_FIELDSET
           
static int TAG_FONT
           
static int TAG_FORM
           
static int TAG_H1
           
static int TAG_H2
           
static int TAG_H3
           
static int TAG_H4
           
static int TAG_H5
           
static int TAG_H6
           
static int TAG_HEAD
           
static int TAG_HR
           
static int TAG_HTML
           
static int TAG_I
           
static int TAG_IMG
           
static int TAG_INPUT
           
static int TAG_INS
           
static int TAG_KBD
           
static int TAG_LABEL
           
static int TAG_LEGEND
           
static int TAG_LI
           
static int TAG_LINK
           
static int TAG_MAP
           
static int TAG_MENU
           
static int TAG_META
           
static int TAG_NOFRAMES
           
static int TAG_NOSCRIPT
           
static int TAG_OBJECT
           
static int TAG_OL
           
static int TAG_OPTGROUP
           
static int TAG_OPTION
           
static int TAG_P
           
static int TAG_PARAM
           
static int TAG_PRE
           
static int TAG_Q
           
static int TAG_S
           
static int TAG_SAMP
           
static int TAG_SELECT
           
static int TAG_SMALL
           
static int TAG_SPAN
           
static int TAG_STRIKE
           
static int TAG_STRONG
           
static int TAG_STYLE
           
static int TAG_SUB
           
static int TAG_SUP
           
static int TAG_TABLE
           
static int TAG_TBODY
           
static int TAG_TD
           
static int TAG_TEXT
           
static int TAG_TEXTAREA
           
static int TAG_TFOOT
           
static int TAG_TH
           
static int TAG_THEAD
           
static int TAG_TITLE
           
static int TAG_TR
           
static int TAG_TT
           
static int TAG_U
           
static int TAG_UL
           
static int TAG_UNSUPPORTED
           
static int TAG_VAR
           
 
Fields inherited from class com.sun.lwuit.xml.Element
DEPTH_INFINITE
 
Constructor Summary
protected HTMLElement()
          Constructs and HTMLElement without specifying a name.
  HTMLElement(java.lang.String tagName)
          Constructor for HTMLElement.
  HTMLElement(java.lang.String tagName, boolean isTextElement)
          Constructor for HTMLElement.
 
Method Summary
 void addChild(Element childElement)
          Adds the specified Element as a child to this element.
 java.lang.String getAttribute(java.lang.String name)
          Returns the attribute value by its name (or null if it wasn't defined for this element)
 java.lang.String getAttributeById(int id)
          Returns an HTMLElement's attribute by the attribute's ID (One of the ATTR_* constants)
 java.lang.String getAttributeName(java.lang.Integer attrKey)
          Returns the attribute name of the requested attribute
 java.util.Vector getDescendantsByTagId(int tagId)
          Returns all descendants with the specified tag id
 java.util.Vector getDescendantsByTagId(int tagId, int depth)
          Returns all descendants with the specified tag id
 HTMLElement getFirstChildByTagId(int tagId)
          Returns an HTMLElement's child by a tag ID (One of the TAG_* constants)
 java.lang.String getSupportedAttributesList()
          Returns a list of supported attributes for this tag.
 int getTagId()
          Returns this HTMLElement's ID
 java.lang.String getTagName()
          Returns this HTMLElement's tag name
 void removeAttributeById(int attrId)
          Removes the specified attribute
 void removeChildAt(int index)
          Removes the child at the given index
 int setAttribute(java.lang.String attribute, java.lang.String value)
          Adds the specified attribute and value to this Element if it is supported for the Element and has a valid value.
 void setAttributeById(int attrId, java.lang.String value)
          Allows setting an attribute with an attribute id
protected  void setTagId(int tagId)
          Sets this HTMLElement's ID
 java.lang.String toString()
          Returns a printable string representing this element
 
Methods inherited from class com.sun.lwuit.xml.Element
contains, getAttributes, getChildAt, getChildIndex, getChildren, getChildrenByTagName, getDescendantsByTagName, getDescendantsByTagName, getElementById, getFirstChildByTagName, getNumChildren, getParent, getText, getTextChildren, getTextDescendants, getTextDescendants, insertChildAt, isTextElement, removeAttribute, removeAttribute, replaceChild, setAttribute, setChildren, setParent, setTagName, setText, setTextElement
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TAG_CSS_ILLEGAL_SELECTOR

public static final int TAG_CSS_ILLEGAL_SELECTOR
See Also:
Constant Field Values

TAG_CSS_SELECTOR

public static final int TAG_CSS_SELECTOR
See Also:
Constant Field Values

TAG_UNSUPPORTED

public static final int TAG_UNSUPPORTED
See Also:
Constant Field Values

TAG_BODY

public static final int TAG_BODY
See Also:
Constant Field Values

TAG_HEAD

public static final int TAG_HEAD
See Also:
Constant Field Values

TAG_HTML

public static final int TAG_HTML
See Also:
Constant Field Values

TAG_TITLE

public static final int TAG_TITLE
See Also:
Constant Field Values

TAG_ABBR

public static final int TAG_ABBR
See Also:
Constant Field Values

TAG_ACRONYM

public static final int TAG_ACRONYM
See Also:
Constant Field Values

TAG_ADDRESS

public static final int TAG_ADDRESS
See Also:
Constant Field Values

TAG_BLOCKQUOTE

public static final int TAG_BLOCKQUOTE
See Also:
Constant Field Values

TAG_BR

public static final int TAG_BR
See Also:
Constant Field Values

TAG_CITE

public static final int TAG_CITE
See Also:
Constant Field Values

TAG_CODE

public static final int TAG_CODE
See Also:
Constant Field Values

TAG_DFN

public static final int TAG_DFN
See Also:
Constant Field Values

TAG_DIV

public static final int TAG_DIV
See Also:
Constant Field Values

TAG_EM

public static final int TAG_EM
See Also:
Constant Field Values

TAG_H1

public static final int TAG_H1
See Also:
Constant Field Values

TAG_H2

public static final int TAG_H2
See Also:
Constant Field Values

TAG_H3

public static final int TAG_H3
See Also:
Constant Field Values

TAG_H4

public static final int TAG_H4
See Also:
Constant Field Values

TAG_H5

public static final int TAG_H5
See Also:
Constant Field Values

TAG_H6

public static final int TAG_H6
See Also:
Constant Field Values

TAG_KBD

public static final int TAG_KBD
See Also:
Constant Field Values

TAG_P

public static final int TAG_P
See Also:
Constant Field Values

TAG_PRE

public static final int TAG_PRE
See Also:
Constant Field Values

TAG_Q

public static final int TAG_Q
See Also:
Constant Field Values

TAG_SAMP

public static final int TAG_SAMP
See Also:
Constant Field Values

TAG_SPAN

public static final int TAG_SPAN
See Also:
Constant Field Values

TAG_STRONG

public static final int TAG_STRONG
See Also:
Constant Field Values

TAG_VAR

public static final int TAG_VAR
See Also:
Constant Field Values

TAG_A

public static final int TAG_A
See Also:
Constant Field Values

TAG_DL

public static final int TAG_DL
See Also:
Constant Field Values

TAG_DT

public static final int TAG_DT
See Also:
Constant Field Values

TAG_DD

public static final int TAG_DD
See Also:
Constant Field Values

TAG_OL

public static final int TAG_OL
See Also:
Constant Field Values

TAG_UL

public static final int TAG_UL
See Also:
Constant Field Values

TAG_LI

public static final int TAG_LI
See Also:
Constant Field Values

TAG_FORM

public static final int TAG_FORM
See Also:
Constant Field Values

TAG_INPUT

public static final int TAG_INPUT
See Also:
Constant Field Values

TAG_LABEL

public static final int TAG_LABEL
See Also:
Constant Field Values

TAG_SELECT

public static final int TAG_SELECT
See Also:
Constant Field Values

TAG_OPTION

public static final int TAG_OPTION
See Also:
Constant Field Values

TAG_TEXTAREA

public static final int TAG_TEXTAREA
See Also:
Constant Field Values

TAG_CAPTION

public static final int TAG_CAPTION
See Also:
Constant Field Values

TAG_TABLE

public static final int TAG_TABLE
See Also:
Constant Field Values

TAG_TD

public static final int TAG_TD
See Also:
Constant Field Values

TAG_TH

public static final int TAG_TH
See Also:
Constant Field Values

TAG_TR

public static final int TAG_TR
See Also:
Constant Field Values

TAG_IMG

public static final int TAG_IMG
See Also:
Constant Field Values

TAG_OBJECT

public static final int TAG_OBJECT
See Also:
Constant Field Values

TAG_PARAM

public static final int TAG_PARAM
See Also:
Constant Field Values

TAG_META

public static final int TAG_META
See Also:
Constant Field Values

TAG_LINK

public static final int TAG_LINK
See Also:
Constant Field Values

TAG_BASE

public static final int TAG_BASE
See Also:
Constant Field Values

TAG_HR

public static final int TAG_HR
See Also:
Constant Field Values

TAG_OPTGROUP

public static final int TAG_OPTGROUP
See Also:
Constant Field Values

TAG_STYLE

public static final int TAG_STYLE
See Also:
Constant Field Values

TAG_B

public static final int TAG_B
See Also:
Constant Field Values

TAG_I

public static final int TAG_I
See Also:
Constant Field Values

TAG_BIG

public static final int TAG_BIG
See Also:
Constant Field Values

TAG_SMALL

public static final int TAG_SMALL
See Also:
Constant Field Values

TAG_FIELDSET

public static final int TAG_FIELDSET
See Also:
Constant Field Values

TAG_U

public static final int TAG_U
See Also:
Constant Field Values

TAG_FONT

public static final int TAG_FONT
See Also:
Constant Field Values

TAG_DEL

public static final int TAG_DEL
See Also:
Constant Field Values

TAG_INS

public static final int TAG_INS
See Also:
Constant Field Values

TAG_TT

public static final int TAG_TT
See Also:
Constant Field Values

TAG_BASEFONT

public static final int TAG_BASEFONT
See Also:
Constant Field Values

TAG_MENU

public static final int TAG_MENU
See Also:
Constant Field Values

TAG_S

public static final int TAG_S
See Also:
Constant Field Values

TAG_STRIKE

public static final int TAG_STRIKE
See Also:
Constant Field Values

TAG_CENTER

public static final int TAG_CENTER
See Also:
Constant Field Values

TAG_DIR

public static final int TAG_DIR
See Also:
Constant Field Values

TAG_MAP

public static final int TAG_MAP
See Also:
Constant Field Values

TAG_AREA

public static final int TAG_AREA
See Also:
Constant Field Values

TAG_LEGEND

public static final int TAG_LEGEND
See Also:
Constant Field Values

TAG_SUB

public static final int TAG_SUB
See Also:
Constant Field Values

TAG_SUP

public static final int TAG_SUP
See Also:
Constant Field Values

TAG_NOSCRIPT

public static final int TAG_NOSCRIPT
See Also:
Constant Field Values

TAG_NOFRAMES

public static final int TAG_NOFRAMES
See Also:
Constant Field Values

TAG_THEAD

public static final int TAG_THEAD
See Also:
Constant Field Values

TAG_TBODY

public static final int TAG_TBODY
See Also:
Constant Field Values

TAG_TFOOT

public static final int TAG_TFOOT
See Also:
Constant Field Values

TAG_TEXT

public static final int TAG_TEXT
See Also:
Constant Field Values

ATTR_CLASS

public static final int ATTR_CLASS
See Also:
Constant Field Values

ATTR_ID

public static final int ATTR_ID
See Also:
Constant Field Values

ATTR_STYLE

public static final int ATTR_STYLE
See Also:
Constant Field Values

ATTR_TITLE

public static final int ATTR_TITLE
See Also:
Constant Field Values

ATTR_XMLNS

public static final int ATTR_XMLNS
See Also:
Constant Field Values

ATTR_XMLLANG

public static final int ATTR_XMLLANG
See Also:
Constant Field Values

ATTR_ALIGN

public static final int ATTR_ALIGN
See Also:
Constant Field Values

ATTR_BGCOLOR

public static final int ATTR_BGCOLOR
See Also:
Constant Field Values

ATTR_LINK

public static final int ATTR_LINK
See Also:
Constant Field Values

ATTR_TEXT

public static final int ATTR_TEXT
See Also:
Constant Field Values

ATTR_VERSION

public static final int ATTR_VERSION
See Also:
Constant Field Values

ATTR_CITE

public static final int ATTR_CITE
See Also:
Constant Field Values

ATTR_ACCESSKEY

public static final int ATTR_ACCESSKEY
See Also:
Constant Field Values

ATTR_CHARSET

public static final int ATTR_CHARSET
See Also:
Constant Field Values

ATTR_HREF

public static final int ATTR_HREF
See Also:
Constant Field Values

ATTR_HREFLANG

public static final int ATTR_HREFLANG
See Also:
Constant Field Values

ATTR_REL

public static final int ATTR_REL
See Also:
Constant Field Values

ATTR_REV

public static final int ATTR_REV
See Also:
Constant Field Values

ATTR_TABINDEX

public static final int ATTR_TABINDEX
See Also:
Constant Field Values

ATTR_TYPE

public static final int ATTR_TYPE
See Also:
Constant Field Values

ATTR_ACTION

public static final int ATTR_ACTION
See Also:
Constant Field Values

ATTR_ENCTYPE

public static final int ATTR_ENCTYPE
See Also:
Constant Field Values

ATTR_METHOD

public static final int ATTR_METHOD
See Also:
Constant Field Values

ATTR_WIDTH

public static final int ATTR_WIDTH
See Also:
Constant Field Values

ATTR_HEIGHT

public static final int ATTR_HEIGHT
See Also:
Constant Field Values

ATTR_ALT

public static final int ATTR_ALT
See Also:
Constant Field Values

ATTR_HSPACE

public static final int ATTR_HSPACE
See Also:
Constant Field Values

ATTR_VSPACE

public static final int ATTR_VSPACE
See Also:
Constant Field Values

ATTR_LONGDESC

public static final int ATTR_LONGDESC
See Also:
Constant Field Values

ATTR_LOCALSRC

public static final int ATTR_LOCALSRC
See Also:
Constant Field Values

ATTR_SRC

public static final int ATTR_SRC
See Also:
Constant Field Values

ATTR_SIZE

public static final int ATTR_SIZE
See Also:
Constant Field Values

ATTR_CHECKED

public static final int ATTR_CHECKED
See Also:
Constant Field Values

ATTR_EMPTYOK

public static final int ATTR_EMPTYOK
See Also:
Constant Field Values

ATTR_FORMAT

public static final int ATTR_FORMAT
See Also:
Constant Field Values

ATTR_ISTYLE

public static final int ATTR_ISTYLE
See Also:
Constant Field Values

ATTR_MAXLENGTH

public static final int ATTR_MAXLENGTH
See Also:
Constant Field Values

ATTR_NAME

public static final int ATTR_NAME
See Also:
Constant Field Values

ATTR_VALUE

public static final int ATTR_VALUE
See Also:
Constant Field Values

ATTR_FOR

public static final int ATTR_FOR
See Also:
Constant Field Values

ATTR_XMLSPACE

public static final int ATTR_XMLSPACE
See Also:
Constant Field Values

ATTR_MULTIPLE

public static final int ATTR_MULTIPLE
See Also:
Constant Field Values

ATTR_SELECTED

public static final int ATTR_SELECTED
See Also:
Constant Field Values

ATTR_ABBR

public static final int ATTR_ABBR
See Also:
Constant Field Values

ATTR_AXIS

public static final int ATTR_AXIS
See Also:
Constant Field Values

ATTR_COLSPAN

public static final int ATTR_COLSPAN
See Also:
Constant Field Values

ATTR_HEADERS

public static final int ATTR_HEADERS
See Also:
Constant Field Values

ATTR_ROWSPAN

public static final int ATTR_ROWSPAN
See Also:
Constant Field Values

ATTR_SCOPE

public static final int ATTR_SCOPE
See Also:
Constant Field Values

ATTR_VALIGN

public static final int ATTR_VALIGN
See Also:
Constant Field Values

ATTR_START

public static final int ATTR_START
See Also:
Constant Field Values

ATTR_MEDIA

public static final int ATTR_MEDIA
See Also:
Constant Field Values

ATTR_LABEL

public static final int ATTR_LABEL
See Also:
Constant Field Values

ATTR_SUMMARY

public static final int ATTR_SUMMARY
See Also:
Constant Field Values

ATTR_CONTENT

public static final int ATTR_CONTENT
See Also:
Constant Field Values

ATTR_HTTPEQUIV

public static final int ATTR_HTTPEQUIV
See Also:
Constant Field Values

ATTR_SCHEME

public static final int ATTR_SCHEME
See Also:
Constant Field Values

ATTR_COLS

public static final int ATTR_COLS
See Also:
Constant Field Values

ATTR_ROWS

public static final int ATTR_ROWS
See Also:
Constant Field Values

ATTR_DIR

public static final int ATTR_DIR
See Also:
Constant Field Values

ATTR_BORDER

public static final int ATTR_BORDER
See Also:
Constant Field Values

ATTR_COLOR

public static final int ATTR_COLOR
See Also:
Constant Field Values

ATTR_FACE

public static final int ATTR_FACE
See Also:
Constant Field Values

ATTR_SHAPE

public static final int ATTR_SHAPE
See Also:
Constant Field Values

ATTR_COORDS

public static final int ATTR_COORDS
See Also:
Constant Field Values

ATTR_USEMAP

public static final int ATTR_USEMAP
See Also:
Constant Field Values

ATTR_LANG

public static final int ATTR_LANG
See Also:
Constant Field Values

ATTR_CELLSPACING

public static final int ATTR_CELLSPACING
See Also:
Constant Field Values

ATTR_CELLPADDING

public static final int ATTR_CELLPADDING
See Also:
Constant Field Values

ATTR_FRAME

public static final int ATTR_FRAME
See Also:
Constant Field Values

ATTR_RULES

public static final int ATTR_RULES
See Also:
Constant Field Values

ATTR_DISABLED

public static final int ATTR_DISABLED
See Also:
Constant Field Values

ATTR_READONLY

public static final int ATTR_READONLY
See Also:
Constant Field Values

ATTR_ISMAP

public static final int ATTR_ISMAP
See Also:
Constant Field Values

COLOR_AQUA

public static final int COLOR_AQUA
See Also:
Constant Field Values

COLOR_BLACK

public static final int COLOR_BLACK
See Also:
Constant Field Values

COLOR_BLUE

public static final int COLOR_BLUE
See Also:
Constant Field Values

COLOR_FUCHSIA

public static final int COLOR_FUCHSIA
See Also:
Constant Field Values

COLOR_GRAY

public static final int COLOR_GRAY
See Also:
Constant Field Values

COLOR_GREEN

public static final int COLOR_GREEN
See Also:
Constant Field Values

COLOR_LIME

public static final int COLOR_LIME
See Also:
Constant Field Values

COLOR_MAROON

public static final int COLOR_MAROON
See Also:
Constant Field Values

COLOR_NAVY

public static final int COLOR_NAVY
See Also:
Constant Field Values

COLOR_OLIVE

public static final int COLOR_OLIVE
See Also:
Constant Field Values

COLOR_PURPLE

public static final int COLOR_PURPLE
See Also:
Constant Field Values

COLOR_RED

public static final int COLOR_RED
See Also:
Constant Field Values

COLOR_SILVER

public static final int COLOR_SILVER
See Also:
Constant Field Values

COLOR_TEAL

public static final int COLOR_TEAL
See Also:
Constant Field Values

COLOR_WHITE

public static final int COLOR_WHITE
See Also:
Constant Field Values

COLOR_YELLOW

public static final int COLOR_YELLOW
See Also:
Constant Field Values

COLOR_ORANGE

public static final int COLOR_ORANGE
See Also:
Constant Field Values
Constructor Detail

HTMLElement

protected HTMLElement()
Constructs and HTMLElement without specifying a name. This can be used by subclasses that do not require name assigments.


HTMLElement

public HTMLElement(java.lang.String tagName)
Constructor for HTMLElement. This mostly sets up the element's ID.

Parameters:
tagName - The HTMLElement's name

HTMLElement

public HTMLElement(java.lang.String tagName,
                   boolean isTextElement)
Constructor for HTMLElement. This mostly sets up the element's ID.

Parameters:
tagName - The HTMLElement's name, or the text for text elements
isTextElement - true for a text element, false otherwise
Method Detail

addChild

public void addChild(Element childElement)
Description copied from class: Element
Adds the specified Element as a child to this element. If the specified element was found to be unsupported (i.e. it's ID is TAG_UNSUPPORTED, it is not added.

Overrides:
addChild in class Element
Parameters:
childElement - The child element

setAttribute

public int setAttribute(java.lang.String attribute,
                        java.lang.String value)
Adds the specified attribute and value to this Element if it is supported for the Element and has a valid value.

Overrides:
setAttribute in class Element
Parameters:
attribute - The attribute's name
value - The attribute's value
Returns:
a positive error code or -1 if attribute is supported and valid

setAttributeById

public void setAttributeById(int attrId,
                             java.lang.String value)
Allows setting an attribute with an attribute id

Parameters:
attrId - The attribute Id (One of the ATTR_ constants)
value - The value to set to the attribute

removeAttributeById

public void removeAttributeById(int attrId)
Removes the specified attribute

Parameters:
attrId - The attribute Id (One of the ATTR_ constants)

getSupportedAttributesList

public java.lang.String getSupportedAttributesList()
Returns a list of supported attributes for this tag. Note that the list does not include the core attributes that are supported on almost all tags

Returns:
a list of supported attributes for this tag

getTagName

public java.lang.String getTagName()
Returns this HTMLElement's tag name

Overrides:
getTagName in class Element
Returns:
the HTMLElement's tag name

getTagId

public int getTagId()
Returns this HTMLElement's ID

Returns:
the HTMLELement's ID

setTagId

protected void setTagId(int tagId)
Sets this HTMLElement's ID

Parameters:
tagId - The tag ID to set, one of the TAG_* constants (Not to be confused with the id attribute)

getFirstChildByTagId

public HTMLElement getFirstChildByTagId(int tagId)
Returns an HTMLElement's child by a tag ID (One of the TAG_* constants)

Parameters:
tagId - The child's tag ID, one of the TAG_* constants (Not to be confused with the id attribute)
Returns:
the first child with the specified ID, or null if not found

getAttributeById

public java.lang.String getAttributeById(int id)
Returns an HTMLElement's attribute by the attribute's ID (One of the ATTR_* constants)

Parameters:
id - The attribute's ID
Returns:
the attribute with the specified ID, or null if not found

toString

public java.lang.String toString()
Returns a printable string representing this element

Overrides:
toString in class Element
Returns:
a printable string representing this element

getAttributeName

public java.lang.String getAttributeName(java.lang.Integer attrKey)
Returns the attribute name of the requested attribute

Parameters:
attrKey - The attribute key, which is typically an Integer object made of its int attrId
Returns:
the attribute name of the requested attribute

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Description copied from class: Element
Returns the attribute value by its name (or null if it wasn't defined for this element)

Overrides:
getAttribute in class Element
Parameters:
name - The attribute id
Returns:
the attribute value by its name (or null if it wasn't defined for this element)

removeChildAt

public void removeChildAt(int index)
Removes the child at the given index

Overrides:
removeChildAt in class Element
Parameters:
index - The child's index

getDescendantsByTagId

public java.util.Vector getDescendantsByTagId(int tagId,
                                              int depth)
Returns all descendants with the specified tag id

Parameters:
tagId - The tag ID to look for, one of the TAG_* constants (Not to be confused with the id attribute)
depth - The search depth (1 - children, 2 - grandchildren .... DEPTH_INFINITE - for all descendants)
Returns:
A vector containing descendants with the specified tag id

getDescendantsByTagId

public java.util.Vector getDescendantsByTagId(int tagId)
Returns all descendants with the specified tag id

Parameters:
tagId - The tag ID to look for, one of the TAG_* constants (Not to be confused with the id attribute)
Returns:
A vector containing descendants with the specified tag id