Class Attribute
java.lang.Object
com.itextpdf.styledxmlparser.jsoup.nodes.Attribute
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String[]private String(package private) Attributesprivate String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()static AttributecreateFromEncoded(String unencodedKey, String encodedValue) Create a new Attribute from an unencoded key and a HTML attribute encoded value.booleangetKey()Get the attribute key.getValue()Get the attribute value.booleanCheck if this Attribute has a value.inthashCode()html()Get the HTML representation of this attribute; e.g.protected voidhtml(Appendable accum, Document.OutputSettings out) protected static voidhtml(String key, String val, Appendable accum, Document.OutputSettings out) protected static booleanisBooleanAttribute(String key) Checks if this attribute name is defined as a boolean attribute in HTML5protected booleanprotected static booleanisDataAttribute(String key) voidSet the attribute key; case is preserved.Set the attribute value.protected final booleanCollapsible if it's a boolean attribute and value is empty or same as nameprotected static booleanshouldCollapseAttribute(String key, String val, Document.OutputSettings out) toString()Get the string representation of this attribute, implemented ashtml().
-
Field Details
-
booleanAttributes
-
key
-
val
-
parent
Attributes parent
-
-
Constructor Details
-
Attribute
-
Attribute
Create a new attribute from unencoded (raw) key and value.- Parameters:
key- attribute key; case is preserved.val- attribute value (may be null)parent- the containing Attributes (this Attribute is not automatically added to said Attributes)- See Also:
-
-
Method Details
-
getKey
-
setKey
Set the attribute key; case is preserved.- Parameters:
key- the new key; must not be null
-
getValue
-
hasDeclaredValue
public boolean hasDeclaredValue()Check if this Attribute has a value. Set boolean attributes have no value.- Returns:
- if this is a boolean attribute / attribute without a value
-
setValue
-
html
Get the HTML representation of this attribute; e.g.href="index.html".- Returns:
- HTML
-
html
protected static void html(String key, String val, Appendable accum, Document.OutputSettings out) throws IOException - Throws:
IOException
-
html
- Throws:
IOException
-
toString
-
createFromEncoded
Create a new Attribute from an unencoded key and a HTML attribute encoded value.- Parameters:
unencodedKey- assumes the key is not encoded, as can be only run of simple \w chars.encodedValue- HTML attribute encoded value- Returns:
- attribute
-
isDataAttribute
protected boolean isDataAttribute() -
isDataAttribute
-
shouldCollapseAttribute
Collapsible if it's a boolean attribute and value is empty or same as name- Parameters:
out- output settings- Returns:
- Returns whether collapsible or not
-
shouldCollapseAttribute
protected static boolean shouldCollapseAttribute(String key, String val, Document.OutputSettings out) -
isBooleanAttribute
Checks if this attribute name is defined as a boolean attribute in HTML5 -
equals
-
hashCode
-
clone
-