@FunctionalInterface
public interface ElementNameConverter
| Modifier and Type | Field | Description |
|---|---|---|
static ElementNameConverter |
IDENTITY |
An element name converter that returns the name unchanged.
|
| Modifier and Type | Method | Description |
|---|---|---|
default ElementNameConverter |
andThen(ElementNameConverter other) |
Returns a converter that first applies this converter and then
other. |
default ElementNameConverter |
compose(ElementNameConverter other) |
Returns a converter that first applies
other then this converter. |
java.lang.String |
convertElementName(Parent parent,
java.lang.String name) |
Returns the element name to use instead of the original name.
|
static ElementNameConverter |
fromNameFunction(java.util.function.Function<java.lang.String,java.lang.String> function) |
Creates a new ElementNameConverter from a name converter function.
|
static ElementNameConverter |
fromNameMap(java.util.Map<java.lang.String,java.lang.String> map) |
Creates a new AttributeNameConverter from a map.
|
static ElementNameConverter |
fromPathMap(java.util.Map<SPath,java.lang.String> map) |
static final ElementNameConverter IDENTITY
java.lang.String convertElementName(Parent parent, java.lang.String name)
parent - The element parent.name - The element name.default ElementNameConverter compose(ElementNameConverter other)
other then this converter.other - The other converter.other then this converter.java.lang.IllegalArgumentException - When other is null.default ElementNameConverter andThen(ElementNameConverter other)
other.other - The other converter.other.java.lang.IllegalArgumentException - When other is null.static ElementNameConverter fromNameFunction(java.util.function.Function<java.lang.String,java.lang.String> function)
Conversion is independent of element.
function - The function used to convert elements names.function.java.lang.IllegalArgumentException - When function is null.static ElementNameConverter 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 ElementNameConverter fromPathMap(java.util.Map<SPath,java.lang.String> map)
Copyright © 2019. All rights reserved.