Constructor and Description |
---|
Attribute(String key,
String value)
Create a new attribute from unencoded (raw) key and value.
|
Modifier and Type | Method and Description |
---|---|
Attribute |
clone() |
static Attribute |
createFromEncoded(String unencodedKey,
String encodedValue)
Create a new Attribute from an unencoded key and a HTML attribute encoded value.
|
boolean |
equals(Object o) |
String |
getKey()
Get the attribute key.
|
String |
getValue()
Get the attribute value.
|
int |
hashCode() |
String |
html()
Get the HTML representation of this attribute; e.g.
|
protected void |
html(StringBuilder accum,
Document.OutputSettings out) |
protected boolean |
isDataAttribute() |
void |
setKey(String key)
Set the attribute key.
|
String |
setValue(String value)
Set the attribute value.
|
String |
toString()
Get the string representation of this attribute, implemented as
html() . |
public Attribute(String key, String value)
key
- attribute keyvalue
- attribute valuecreateFromEncoded(java.lang.String, java.lang.String)
public String getKey()
public void setKey(String key)
key
- the new key; must not be nullpublic String getValue()
public String html()
href="index.html"
.protected void html(StringBuilder accum, Document.OutputSettings out)
public String toString()
html()
.public static Attribute createFromEncoded(String unencodedKey, 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(Object o)
public int hashCode()
Copyright © 2009–2013 Jonathan Hedley. All rights reserved.