public class MutableAttributeImpl extends Object implements MutableAttribute
CLASS_ATTR, ID_ATTR, LINK_STATUS_ATTR, NAME_ATTR, NO_FOLLOW, NON_RENDERING_WHEN_EMPTY, NUL, STYLE_ATTR, TARGET_ATTR, TITLE_ATTR| Modifier and Type | Method and Description |
|---|---|
boolean |
containsValue(CharSequence value)
See if the attribute contains the value (if attribute has list delimiter set) or is equal to the value if no list delimiter is set
|
MutableAttribute |
copy() |
boolean |
equals(Object o) |
String |
getName() |
String |
getValue() |
char |
getValueListDelimiter() |
protected Map<String,String> |
getValueMap() |
char |
getValueNameDelimiter() |
int |
hashCode() |
boolean |
isNonRendering() |
static MutableAttributeImpl |
of(Attribute other) |
static MutableAttributeImpl |
of(CharSequence attrName) |
static MutableAttributeImpl |
of(CharSequence attrName,
CharSequence value) |
static MutableAttributeImpl |
of(CharSequence attrName,
CharSequence value,
char valueListDelimiter) |
static MutableAttributeImpl |
of(CharSequence attrName,
CharSequence value,
char valueListDelimiter,
char valueNameDelimiter) |
MutableAttributeImpl |
removeValue(CharSequence value)
Add a new value or values depending on list and name delimiter settings and value content.
|
MutableAttributeImpl |
replaceValue(CharSequence value)
Replace the complete value of this attribute by a new value
|
void |
resetToValuesMap() |
MutableAttributeImpl |
setValue(CharSequence value)
Add a new value or values depending on list and name delimiter settings and value content
If the attribute does not have a list delimiter then its value will be set
to the given value.
|
Attribute |
toImmutable() |
MutableAttribute |
toMutable() |
String |
toString() |
protected String |
valueFromMap()
Return the attribute value string by splicing the values of the map using myValueListDelimiter and myValueNameDelimiter
with replacements of the given name/value if provided.
|
public char getValueListDelimiter()
getValueListDelimiter in interface Attributepublic char getValueNameDelimiter()
getValueNameDelimiter in interface Attributepublic Attribute toImmutable()
toImmutable in interface Mutable<MutableAttribute,Attribute>public MutableAttribute toMutable()
toMutable in interface Immutable<Attribute,MutableAttribute>public MutableAttribute copy()
copy in interface MutableAttributepublic void resetToValuesMap()
protected String valueFromMap()
public boolean isNonRendering()
isNonRendering in interface Attributepublic MutableAttributeImpl replaceValue(CharSequence value)
AttributereplaceValue in interface AttributereplaceValue in interface MutableAttributevalue - new valuepublic MutableAttributeImpl setValue(CharSequence value)
AttributesetValue in interface AttributesetValue in interface MutableAttributevalue - value or list of values (if attribute has a list delimiter and name delimiter) to changepublic MutableAttributeImpl removeValue(CharSequence value)
AttributeremoveValue in interface AttributeremoveValue in interface MutableAttributevalue - value or list of values (if attribute has a list delimiter and name delimiter) to removepublic boolean containsValue(CharSequence value)
AttributecontainsValue in interface AttributecontainsValue in interface MutableAttributevalue - name part of the attribute value list or the value if the attribute does not have a value list delimiterpublic static MutableAttributeImpl of(Attribute other)
public static MutableAttributeImpl of(CharSequence attrName)
public static MutableAttributeImpl of(CharSequence attrName, CharSequence value)
public static MutableAttributeImpl of(CharSequence attrName, CharSequence value, char valueListDelimiter)
public static MutableAttributeImpl of(CharSequence attrName, CharSequence value, char valueListDelimiter, char valueNameDelimiter)
Copyright © 2019. All rights reserved.