|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectau.id.jericho.lib.html.Segment
au.id.jericho.lib.html.Element
Represents an HTML element,
which encompasses the StartTag
, an optional EndTag
and all content in between.
If the start tag has no corresponding end tag:
Created using the Segment.findAllElements(String name)
or StartTag.getElement()
method.
See also the XML 1.0 specification for elements.
StartTag
Method Summary | |
Attributes |
getAttributes()
Returns the attributes specified in this element's start tag. |
Segment |
getContent()
Returns the segment representing the content of the element. |
java.lang.String |
getContentText()
Returns the content text of the element. |
java.lang.String |
getDebugInfo()
Returns a string representation of this object useful for debugging purposes. |
EndTag |
getEndTag()
Returns the end tag of the element. |
FormControl |
getFormControl()
Returns the FormControl defined by this element. |
java.lang.String |
getName()
Returns the name of the StartTag of this element. |
StartTag |
getStartTag()
Returns the start tag of the element. |
static boolean |
isBlock(java.lang.String name)
Indicates whether an element with the given name is a block element according to the HTML 4.01 Transitional DTD. |
boolean |
isEmpty()
Indicates whether the element is empty. |
boolean |
isEmptyElementTag()
Indicates whether the element is an empty element tag. |
static boolean |
isInline(java.lang.String name)
Indicates whether an element with the given name is an inline element according to the HTML 4.01 Transitional DTD. |
Methods inherited from class au.id.jericho.lib.html.Segment |
charAt, compareTo, encloses, encloses, equals, findAllCharacterReferences, findAllComments, findAllElements, findAllElements, findAllStartTags, findAllStartTags, findAllStartTags, findFormControls, findFormFields, findWords, getBegin, getEnd, getSourceText, getSourceTextNoWhitespace, hashCode, ignoreWhenParsing, isComment, isWhiteSpace, length, parseAttributes, subSequence, toString |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
public java.lang.String getContentText()
null
if the element is empty.public Segment getContent()
This segment spans between the end of the start tag and the start of the end tag. If the end tag is not present, the content reaches to the end of the element.
The returned segment is newly created with every call to this method.
Note that before version 1.5 this method returned null
if the element was empty,
whereas now a zero-length segment is returned.
null
.public StartTag getStartTag()
public EndTag getEndTag()
If the element has no end tag this method returns null
.
null
if the element has no end tag.public java.lang.String getName()
public boolean isEmpty()
The representation of an empty element is either a start tag immediately followed by an end tag, or an empty-element tag.
true
if the element is empty, otherwise false
.public boolean isEmptyElementTag()
true
if the element is an empty element tag, otherwise false
.isEmpty()
public static boolean isBlock(java.lang.String name)
A brief description of the difference between block and inline elements is given in the HTML 4.01 Specification section 7.5.3.
true
if an element with the given name is a block element, otherwise false
.public static boolean isInline(java.lang.String name)
A brief description of the difference between block and inline elements is given in the HTML 4.01 Specification section 7.5.3.
true
if an element with the given name is an inline element, otherwise false
.public Attributes getAttributes()
This is equivalent to getStartTag().getAttributes()
StartTag.getAttributes()
public FormControl getFormControl()
FormControl
defined by this element.
FormControl
defined by this element, or null
if it is not a control.public java.lang.String getDebugInfo()
Segment
getDebugInfo
in class Segment
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |