@FunctionalInterface
public interface AttributeValueConverter
| Modifier and Type | Field | Description |
|---|---|---|
static AttributeValueConverter |
INDENTITY |
An attribute value converter that returns the value unchanged.
|
| Modifier and Type | Method | Description |
|---|---|---|
default AttributeValueConverter |
andThen(AttributeValueConverter other) |
Returns a converter that first applies this converter and then
other. |
default AttributeValueConverter |
compose(AttributeValueConverter other) |
Returns a converter that first applies
other then this converter. |
java.lang.String |
convertAttributeValue(Element element,
java.lang.String name,
java.lang.String value) |
Returns the value that should be used instead of the original value.
|
static AttributeValueConverter |
fromNameMap(java.util.Map<java.lang.String,java.lang.String> map) |
Creates a new AttributeValueConverter from an attribute name to value map.
|
static AttributeValueConverter |
fromPathMap(java.util.Map<SPath,java.lang.String> map) |
|
static AttributeValueConverter |
fromString(java.lang.String s) |
|
static AttributeValueConverter |
fromValueFunction(java.util.function.Function<java.lang.String,java.lang.String> function) |
Creates a new AttributeValueConverter from a value converter function.
|
static AttributeValueConverter |
fromValueMap(java.util.Map<java.lang.String,java.lang.String> map) |
Creates a new AttributeValueConverter from an attribute value map.
|
static AttributeValueConverter |
scramble(boolean preserveSpaces) |
static final AttributeValueConverter INDENTITY
java.lang.String convertAttributeValue(Element element, java.lang.String name, java.lang.String value)
element - The element containing the attribute.name - The attribute name.value - The attribute value.default AttributeValueConverter compose(AttributeValueConverter other)
other then this converter.other - The other converter.other then this converter.java.lang.IllegalArgumentException - When other is null.default AttributeValueConverter andThen(AttributeValueConverter other)
other.other - The other converter.other.java.lang.IllegalArgumentException - When other is null.static AttributeValueConverter fromString(java.lang.String s)
static AttributeValueConverter scramble(boolean preserveSpaces)
static AttributeValueConverter fromValueFunction(java.util.function.Function<java.lang.String,java.lang.String> function)
Conversion is independent of element and attribute name.
function - The function used to convert values.function.java.lang.IllegalArgumentException - When function is null.static AttributeValueConverter fromValueMap(java.util.Map<java.lang.String,java.lang.String> map)
Conversion is independent of element and attribute name.
If a value is not mapped, then result is that value.
map - The map.map.java.lang.IllegalArgumentException - When map is null.static AttributeValueConverter fromNameMap(java.util.Map<java.lang.String,java.lang.String> map)
If a name is not mapped, then result is original value.
map - The map.map.static AttributeValueConverter fromPathMap(java.util.Map<SPath,java.lang.String> map)
Copyright © 2019. All rights reserved.