org.jsoup.nodes
public class Attribute extends java.lang.Object implements java.util.Map.Entry<java.lang.String,java.lang.String>, java.lang.Cloneable
Constructor and Description |
---|
Attribute(java.lang.String key,
java.lang.String value)
Create a new attribute from unencoded (raw) key and value.
|
Modifier and Type | Method and Description |
---|---|
Attribute |
clone() |
static Attribute |
createFromEncoded(java.lang.String unencodedKey,
java.lang.String encodedValue)
Create a new Attribute from an unencoded key and a HMTL attribute encoded value.
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getKey()
Get the attribute key.
|
java.lang.String |
getValue()
Get the attribute value.
|
int |
hashCode() |
java.lang.String |
html()
Get the HTML representation of this attribute; e.g.
|
protected void |
html(java.lang.StringBuilder accum,
Document.OutputSettings out) |
protected boolean |
isDataAttribute() |
void |
setKey(java.lang.String key)
Set the attribute key.
|
java.lang.String |
setValue(java.lang.String value)
Set the attribute value.
|
java.lang.String |
toString()
Get the string representation of this attribute, implemented as
html() . |
public Attribute(java.lang.String key, java.lang.String value)
key
- attribute keyvalue
- attribute valuecreateFromEncoded(java.lang.String, java.lang.String)
public java.lang.String getKey()
getKey
in interface java.util.Map.Entry<java.lang.String,java.lang.String>
public void setKey(java.lang.String key)
key
- the new key; must not be nullpublic java.lang.String getValue()
getValue
in interface java.util.Map.Entry<java.lang.String,java.lang.String>
public java.lang.String setValue(java.lang.String value)
setValue
in interface java.util.Map.Entry<java.lang.String,java.lang.String>
value
- the new attribute value; must not be nullpublic java.lang.String html()
href="index.html"
.protected void html(java.lang.StringBuilder accum, Document.OutputSettings out)
public java.lang.String toString()
html()
.toString
in class java.lang.Object
public static Attribute createFromEncoded(java.lang.String unencodedKey, java.lang.String encodedValue)
unencodedKey
- assumes the key is not encoded, as can be only run of simple \w chars.encodedValue
- HTML attribute encoded valueprotected boolean isDataAttribute()
public boolean equals(java.lang.Object o)
equals
in interface java.util.Map.Entry<java.lang.String,java.lang.String>
equals
in class java.lang.Object
public int hashCode()
hashCode
in interface java.util.Map.Entry<java.lang.String,java.lang.String>
hashCode
in class java.lang.Object
public Attribute clone()
clone
in class java.lang.Object
Copyright © 2009-2020 Jonathan Hedley. All Rights Reserved.