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