|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--websphinx.Region
|
+--websphinx.Element
Element in an HTML page. An element runs from a start tag (like <ul>) to its matching end tag (</ul>), inclusive. An element may have an optional end tag (like <p>), in which case the element runs up to (but not including) the tag that implicitly closes it. For example:
<p>Paragraph 1<p>Paragraph 2contains two elements,
<p>Paragraph 1and
<p>Paragraph 2.
| Field Summary | |
protected Element |
child
|
protected Tag |
endTag
|
protected Element |
parent
|
protected Element |
sibling
|
protected Tag |
startTag
|
| Fields inherited from class websphinx.Region |
end, names, source, start, TRUE |
| Constructor Summary | |
Element(Tag startTag,
int end)
Make an Element from a start tag and an end position. |
|
Element(Tag startTag,
Tag endTag)
Make an Element from a start tag and end tag. |
|
| Method Summary | |
java.util.Enumeration |
enumerateHTMLAttributes()
Enumerate the HTML attributes found on this tag. |
Element |
getChild()
Get element's first child. |
Tag |
getEndTag()
Get end tag. |
java.lang.String |
getHTMLAttribute(java.lang.String name)
Get an HTML attribute's value. |
java.lang.String |
getHTMLAttribute(java.lang.String name,
java.lang.String defaultValue)
Get an HTML attribute's value, with a default value if it doesn't exist. |
Element |
getNext()
Return next element in an inorder walk of the tree, assuming this element and its children have been visited. |
Element |
getParent()
Get element's parent. |
Element |
getSibling()
Get element's next sibling. |
Tag |
getStartTag()
Get start tag. |
java.lang.String |
getTagName()
Get tag name. |
boolean |
hasHTMLAttribute(java.lang.String name)
Test if tag has an HTML attribute. |
| Methods inherited from class websphinx.Region |
enumerateObjectLabels, findEnd, findStart, getEnd, getField, getFields, getLabel, getLabel, getLength, getNumericLabel, getObjectLabel, getObjectLabels, getRootElement, getSource, getStart, hasAllLabels, hasAllLabels, hasAnyLabels, hasAnyLabels, hasLabel, removeLabel, setField, setFields, setLabel, setLabel, setObjectLabel, span, toHTML, toString, toTags, toText |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Tag startTag
protected Tag endTag
protected Element sibling
protected Element parent
protected Element child
| Constructor Detail |
public Element(Tag startTag,
Tag endTag)
startTag - Start tag of elementendTag - End tag of element (may be null)
public Element(Tag startTag,
int end)
startTag - Start tag of elementend - Ending offset of element| Method Detail |
public java.lang.String getTagName()
getTagName() == Tag.IMG.public Tag getStartTag()
public Tag getEndTag()
public Element getParent()
public Element getSibling()
public Element getChild()
public Element getNext()
public boolean hasHTMLAttribute(java.lang.String name)
name - Name of HTML attribute (e.g. "HREF"). Doesn't have to be
converted with toHTMLAttributeName().public java.lang.String getHTMLAttribute(java.lang.String name)
name - Name of HTML attribute (e.g. "HREF"). Doesn't have to be
converted with toHTMLAttributeName().
public java.lang.String getHTMLAttribute(java.lang.String name,
java.lang.String defaultValue)
name - Name of HTML attribute (e.g. "HREF"). Doesn't have to be
converted with toHTMLAttributeName().defaultValue - default value to return if the attribute
doesn't existpublic java.util.Enumeration enumerateHTMLAttributes()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||