T - the type of object that this SectionReader can updateFieldAndVarReader, FieldsAndVarsReader@FunctionalInterface
public interface SectionReader<T>
For instance, this may be used to read an object from the input and set it as a field/property of a parent object.
| Modifier and Type | Method | Description |
|---|---|---|
void |
readAndSet(@NotNull Context context,
T object) |
Reads as much input as necessary to update the given object.
|
static <E,P> SectionReader<P> |
settingArray(java.util.function.BiConsumer<? super P,? super E[]> setter,
java.util.function.IntFunction<E[]> arrayCreator,
java.util.function.BiFunction<? super P,Context,java.lang.Integer> getSize,
ChildReader<? extends E,? super P> itemReader) |
|
static <V,T> SectionReader<T> |
settingChild(java.util.function.BiConsumer<? super T,? super V> setter,
ChildReader<? extends V,? super T> valueReader) |
Returns a
SectionReader that reads a child object and sets it on the target object, consuming as much
input as necessary. |
static <E,C extends java.util.Collection<E>,P> |
settingCollection(java.util.function.BiConsumer<? super P,? super C> setter,
java.util.function.IntFunction<C> constructor,
java.util.function.BiFunction<? super P,Context,java.lang.Integer> getSize,
ChildReader<? extends E,? super P> itemReader) |
|
static <T> SectionReader<T> |
settingDouble(java.util.function.ObjDoubleConsumer<T> setter) |
Returns a
SectionReader that reads a double and sets it on the target object, consuming as much input as
necessary. |
static <T> SectionReader<T> |
settingInt(java.util.function.ObjIntConsumer<T> setter) |
Returns a
SectionReader that reads an int and sets it on the target object, consuming as much input as
necessary. |
static <E,P> SectionReader<P> |
settingList(java.util.function.BiConsumer<? super P,? super java.util.List<E>> setter,
java.util.function.BiFunction<? super P,Context,java.lang.Integer> getSize,
ChildReader<? extends E,? super P> itemReader) |
|
static <V,T> SectionReader<T> |
settingObject(java.util.function.BiConsumer<T,? super V> setter,
java.util.function.Function<? super java.lang.String,V> valueConverter) |
Returns a
SectionReader that reads a value and sets it on the target object, consuming as much input as
necessary. |
static <T> SectionReader<T> |
settingString(java.util.function.BiConsumer<T,? super java.lang.String> setter) |
Returns a
SectionReader that reads a string and sets it on the target object, consuming as much input as
necessary. |
void readAndSet(@NotNull
@NotNull Context context,
@Nullable
T object)
throws InputParsingException
context - the context to read fromobject - the object to updateInputParsingException - if something went wrong while reading the inputstatic <T> SectionReader<T> settingString(java.util.function.BiConsumer<T,? super java.lang.String> setter)
SectionReader that reads a string and sets it on the target object, consuming as much input as
necessary.T - the type of object that the returned SectionReader updatessetter - the setter to use to set the value on the target objectSectionReader that reads a value and sets it on the target objectstatic <T> SectionReader<T> settingInt(java.util.function.ObjIntConsumer<T> setter)
SectionReader that reads an int and sets it on the target object, consuming as much input as
necessary.T - the type of object that the returned SectionReader updatessetter - the setter to use to set the value on the target objectSectionReader that reads a value and sets it on the target objectstatic <T> SectionReader<T> settingDouble(java.util.function.ObjDoubleConsumer<T> setter)
SectionReader that reads a double and sets it on the target object, consuming as much input as
necessary.T - the type of object that the returned SectionReader updatessetter - the setter to use to set the value on the target objectSectionReader that reads a value and sets it on the target objectstatic <V,T> SectionReader<T> settingObject(java.util.function.BiConsumer<T,? super V> setter, java.util.function.Function<? super java.lang.String,V> valueConverter)
SectionReader that reads a value and sets it on the target object, consuming as much input as
necessary.V - the type of value that the given converter yieldsT - the type of object that the returned SectionReader updatessetter - the setter to use to set the value on the target objectvalueConverter - a function to convert the string token read from the input into the value to setSectionReader that reads a value and sets it on the target objectstatic <V,T> SectionReader<T> settingChild(java.util.function.BiConsumer<? super T,? super V> setter, ChildReader<? extends V,? super T> valueReader)
SectionReader that reads a child object and sets it on the target object, consuming as much
input as necessary.V - the type of the child object to set, which the given ChildReader createsT - the type of object that the returned SectionReader updatessetter - the setter to use to set the value on the target objectvalueReader - the reader to use to read the child object to setSectionReader that reads a value and sets it on the target objectstatic <E,P> SectionReader<P> settingArray(java.util.function.BiConsumer<? super P,? super E[]> setter, java.util.function.IntFunction<E[]> arrayCreator, java.util.function.BiFunction<? super P,Context,java.lang.Integer> getSize, ChildReader<? extends E,? super P> itemReader)
static <E,P> SectionReader<P> settingList(java.util.function.BiConsumer<? super P,? super java.util.List<E>> setter, java.util.function.BiFunction<? super P,Context,java.lang.Integer> getSize, ChildReader<? extends E,? super P> itemReader)
static <E,C extends java.util.Collection<E>,P> SectionReader<P> settingCollection(java.util.function.BiConsumer<? super P,? super C> setter, java.util.function.IntFunction<C> constructor, java.util.function.BiFunction<? super P,Context,java.lang.Integer> getSize, ChildReader<? extends E,? super P> itemReader)