public abstract class CustomAttribute extends Object implements Serializable
class
which is assembled from a separate list of tokens
instead of being stored as a regular attribute string.
For internal use only. May be renamed or removed in a future release.
Constructor and Description |
---|
CustomAttribute() |
Modifier and Type | Method and Description |
---|---|
static Optional<CustomAttribute> |
get(String name)
Gets the custom attribute with the provided name, if present.
|
abstract String |
getAttribute(Element element)
Gets the value that should be returned by
Element.getAttribute(String) for this attribute. |
static Set<String> |
getNames()
Gets an unmodifiable set of custom attribute names.
|
abstract boolean |
hasAttribute(Element element)
Checks what
Element.hasAttribute(String) should return for this
attribute. |
abstract void |
removeAttribute(Element element)
Removes the attribute when
Element.removeAttribute(String) is
called for this attribute. |
abstract void |
setAttribute(Element element,
String value)
Sets the value when
Element.setAttribute(String, String) is
called for this attribute. |
public static Optional<CustomAttribute> get(String name)
name
- the name of the attributepublic static Set<String> getNames()
public abstract boolean hasAttribute(Element element)
Element.hasAttribute(String)
should return for this
attribute.element
- the element to check, not null
true
if the element has a value for this attribute,
otherwise false
public abstract String getAttribute(Element element)
Element.getAttribute(String)
for this attribute.element
- the element to check, not null
public abstract void setAttribute(Element element, String value)
Element.setAttribute(String, String)
is
called for this attribute.element
- the element for which to set the value, not null
value
- the new attribute value, not null
public abstract void removeAttribute(Element element)
Element.removeAttribute(String)
is
called for this attribute.element
- the element for which to remove the attribute, not
null
Copyright © 2022. All rights reserved.