public interface ValueNode extends Iterable<ValueNode>, Value
Modifier and Type | Method and Description |
---|---|
ValueNode |
get(int index)
Get a value at the given position.
|
ValueNode |
get(String name)
Get a value that matches the given name.
|
default Iterator<ValueNode> |
iterator()
Value iterator.
|
default String |
resolve(String expression)
Process the given expression and resolve value references.
|
default String |
resolve(String expression,
boolean ignoreMissing)
Process the given expression and resolve value references.
|
default String |
resolve(String expression,
boolean ignoreMissing,
String startDelim,
String endDelim)
Process the given expression and resolve value references.
|
default String |
resolve(String expression,
String startDelim,
String endDelim)
Process the given expression and resolve value references.
|
default int |
size()
The number of values this one has.
|
forEach, spliterator
array, booleanValue, booleanValue, byteValue, byteValue, create, create, doubleValue, doubleValue, floatValue, floatValue, hash, intValue, intValue, isArray, isMissing, isObject, isSingle, longValue, longValue, missing, name, to, toEnum, toEnum, toList, toList, toMap, toMultimap, toOptional, toOptional, toSet, toSet, value, value, value, value, valueOrNull
@Nonnull ValueNode get(@Nonnull int index)
index
- Position.@Nonnull ValueNode get(@Nonnull String name)
name
- Field name.default int size()
0
.@Nonnull default String resolve(@Nonnull String expression)
Value value = Value.single("foo", "bar");
String output = value.resolve("${foo}");
System.out.println(output);
expression
- Text expression.@Nonnull default String resolve(@Nonnull String expression, boolean ignoreMissing)
Value value = Value.single("foo", "bar");
String output = value.resolve("${missing}", true);
System.out.println(output);
expression
- Text expression.ignoreMissing
- On missing values, keep the expression as it is.@Nonnull default String resolve(@Nonnull String expression, @Nonnull String startDelim, @Nonnull String endDelim)
Value value = Value.single("foo", "bar");
String output = value.resolve("<%missing%>", "<%", "%>");
System.out.println(output);
expression
- Text expression.startDelim
- Start delimiter.endDelim
- End delimiter.@Nonnull default String resolve(@Nonnull String expression, boolean ignoreMissing, @Nonnull String startDelim, @Nonnull String endDelim)
Value value = Value.single("foo", "bar");
String output = value.resolve("<%missing%>", "<%", "%>");
System.out.println(output);
expression
- Text expression.ignoreMissing
- On missing values, keep the expression as it is.startDelim
- Start delimiter.endDelim
- End delimiter.Copyright © 2021. All rights reserved.