doc.api.au.id.jericho.lib.html.Attribute.html Maven / Gradle / Ivy
Attribute (Jericho HTML Parser 1.5-dev1)
Package
Class
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
au.id.jericho.lib.html
Class Attribute
java.lang.Object
au.id.jericho.lib.html.Segment
au.id.jericho.lib.html.Attribute
- All Implemented Interfaces:
- java.lang.CharSequence, java.lang.Comparable
- public final class Attribute
- extends Segment
Represents a single attribute
name/value segment within a StartTag
.
The methods in this class provide read-only access to a single attribute in the source document.
The AttributesOutputSegment
class provides a means to add, delete or modify attributes and
their values for inclusion in an OutputDocument
.
Created using the Attributes.get(String key)
method.
See also the XML 1.0 specification for attributes.
- See Also:
Attributes
Method Summary
java.lang.String
getDebugInfo()
Returns a string representation of this object useful for debugging purposes.
java.lang.String
getKey()
Name of the attribute in lower case.
java.lang.String
getName()
Returns the name of the attribute in original case.
Segment
getNameSegment()
Segment spanning the Name of the attribute.
char
getQuoteChar()
Returns the character used to quote the value.
java.lang.String
getValue()
Returns the decoded value of the attribute.
Segment
getValueSegment()
Segment spanning the Value of the attribute.
Segment
getValueSegmentIncludingQuotes()
Segment spanning the value of the attribute, including quotation marks if any.
boolean
hasValue()
Indicates whether the attribute has a value.
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
getKey
public java.lang.String getKey()
- Name of the attribute in lower case.
Note that this package treats all attribute names as case in-sensitive, contrary to the XHTML specification.
getNameSegment
public Segment getNameSegment()
- Segment spanning the Name of the attribute.
getValueSegment
public Segment getValueSegment()
- Segment spanning the Value of the attribute.
getValueSegmentIncludingQuotes
public Segment getValueSegmentIncludingQuotes()
- Segment spanning the value of the attribute, including quotation marks if any.
If the value is not enclosed by quotation marks, this is the same as the value segment
getQuoteChar
public char getQuoteChar()
- Returns the character used to quote the value.
This will be either a double-quote (") or a single-quote (').
- Returns:
- the character used to quote the value, or a space if the value is not quoted or the attribute has no value.
getName
public java.lang.String getName()
- Returns the name of the attribute in original case.
- Returns:
- the name of the attribute in original case.
getValue
public java.lang.String getValue()
- Returns the decoded value of the attribute.
Note that before version 1.5 this method returned the raw value of the attribute, without
decoding.
- Returns:
- the decoded value of the attribute, or
null
if the attribute has no value.
hasValue
public boolean hasValue()
- Indicates whether the attribute has a value.
- Returns:
true
if the attribute has a value, otherwise false
.
getDebugInfo
public java.lang.String getDebugInfo()
- Description copied from class:
Segment
- Returns a string representation of this object useful for debugging purposes.
- Overrides:
getDebugInfo
in class Segment
- Returns:
- a string representation of this object useful for debugging purposes.
Package
Class
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD