|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.anadix.html.HtmlElement
public abstract class HtmlElement
Abstract class representing any HTML element. It has generic method to retrieve element's
attribute by name. It also stores id of an element, name of the tag it represents and
parent element. The optional attributes are position of the element in document, source
and text content.
The mandatory attributes are unmodifiable as they define the element. The optional ones
ones can be assigned and changed as necessary. The only constructor is package protected
as instances of HTML element should only be created through HTMLElementFactory.
| Method Summary | |
|---|---|
int |
compareTo(HtmlElement o)
Compares this object with the specified object for order. |
boolean |
equals(Object obj)
|
String |
getAttribute(String name)
Gets value of attribute by name |
Attributes |
getAttributes()
Gets the list of attributes of the element |
BigInteger |
getId()
Gets the id of the element (not the attribute id but the id as assigned by pasrser) |
String |
getName()
Gets the name of the element (not the attribute name but the name of the tag) |
HtmlElement |
getParent()
Gets the parent of the element |
Position |
getPosition()
Gets the position of the element |
String |
getSource()
Gets the source of the element |
String |
getTextContent()
Gets the text content of the element |
int |
hashCode()
|
void |
setPosition(Position position)
Sets the position of the element |
void |
setSource(String source)
Sets the source of the element |
void |
setTextContent(String textContent)
Sets the text content of the element |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public BigInteger getId()
public String getName()
getName in interface Elementpublic HtmlElement getParent()
public Attributes getAttributes()
public String getAttribute(String name)
name - attribute which value should be returned
public void setSource(String source)
source - source of the elementpublic String getSource()
getSource in interface Elementpublic void setPosition(Position position)
position - position of the elementpublic Position getPosition()
public String getTextContent()
public void setTextContent(String textContent)
textContent - text content of the elementpublic int compareTo(HtmlElement o)
compareTo in interface Comparable<HtmlElement>o - HtmlElement to compare this with
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||