java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<String,Object>
org.apache.wicket.util.value.ValueMap
org.apache.wicket.util.value.AttributeMap
Map of values, extending
ValueMap
with methods for generating (HTML) markup attributes.- Since:
- 1.2.6
- Author:
- Eelco Hillenius
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
-
Constructor Summary
ConstructorDescriptionConstructs an emptyAttributeMap
.AttributeMap
(Map<String, Object> map) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
putAttribute
(String key, boolean value) Put a boolean attribute, removing it ifvalue
is false or using the key as value otherwise, i.e.putAttribute
(String key, CharSequence value) Put a string attribute, removing it if the string is empty (nor null).Representation as encoded markup attributes.toString()
Representation as encoded markup attributes.Methods inherited from class org.apache.wicket.util.value.ValueMap
add, clear, getAsBoolean, getAsBoolean, getAsDouble, getAsDouble, getAsDuration, getAsDuration, getAsEnum, getAsEnum, getAsEnum, getAsInstant, getAsInteger, getAsInteger, getAsLong, getAsLong, getAsTime, getBoolean, getCharSequence, getDouble, getDouble, getDuration, getInstant, getInt, getInt, getKey, getLong, getLong, getString, getString, getStringArray, getStringValue, isImmutable, makeImmutable, put, putAll, remove
Methods inherited from class java.util.LinkedHashMap
containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, putIfAbsent, remove, replace, replace, size
Methods inherited from class java.util.AbstractMap
equals, hashCode
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, size, values
-
Constructor Details
-
AttributeMap
public AttributeMap()Constructs an emptyAttributeMap
. -
AttributeMap
Copy constructor.- Parameters:
map
- aMap
to be copied
-
-
Method Details
-
putAttribute
Put a boolean attribute, removing it ifvalue
is false or using the key as value otherwise, i.e.value="value"
.- Parameters:
key
- key of attributevalue
-- Returns:
- previous value
-
putAttribute
Put a string attribute, removing it if the string is empty (nor null).- Parameters:
key
- key of attributevalue
-- Returns:
- previous value
-
toString
Representation as encoded markup attributes. -
toCharSequence
Representation as encoded markup attributes.- See Also:
-