|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jsoup.nodes.Attributes
public class Attributes
The attributes of an Element.
Attributes are treated as a map: there can be only one value associated with an attribute key. Attribute key and value comparisons are done case insensitively, and keys are normalised to lower-case.
| Field Summary | |
|---|---|
protected static java.lang.String |
dataPrefix
|
| Constructor Summary | |
|---|---|
Attributes()
|
|
| Method Summary | |
|---|---|
void |
addAll(Attributes incoming)
Add all the attributes from the incoming set to this set. |
java.util.List<Attribute> |
asList()
Get the attributes as a List, for iteration. |
Attributes |
clone()
|
java.util.Map<java.lang.String,java.lang.String> |
dataset()
Retrieves a filtered view of attributes that are HTML5 custom data attributes; that is, attributes with keys starting with data-. |
boolean |
equals(java.lang.Object o)
|
java.lang.String |
get(java.lang.String key)
Get an attribute value by key. |
int |
hashCode()
|
boolean |
hasKey(java.lang.String key)
Tests if these attributes contain an attribute with this key. |
java.lang.String |
html()
Get the HTML representation of these attributes. |
java.util.Iterator<Attribute> |
iterator()
|
void |
put(Attribute attribute)
Set a new attribute, or replace an existing one by key. |
void |
put(java.lang.String key,
java.lang.String value)
Set a new attribute, or replace an existing one by key. |
void |
remove(java.lang.String key)
Remove an attribute by key. |
int |
size()
Get the number of attributes in this set. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String dataPrefix
| Constructor Detail |
|---|
public Attributes()
| Method Detail |
|---|
public java.lang.String get(java.lang.String key)
key - the attribute key
hasKey(String)
public void put(java.lang.String key,
java.lang.String value)
key - attribute keyvalue - attribute valuepublic void put(Attribute attribute)
attribute - attributepublic void remove(java.lang.String key)
key - attribute key to removepublic boolean hasKey(java.lang.String key)
key - key to check for
public int size()
public void addAll(Attributes incoming)
incoming - attributes to add to these attributes.public java.util.Iterator<Attribute> iterator()
iterator in interface java.lang.Iterable<Attribute>public java.util.List<Attribute> asList()
public java.util.Map<java.lang.String,java.lang.String> dataset()
data-.
public java.lang.String html()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic Attributes clone()
clone in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||