Module com.github.akurilov.commons
Class ExpressionInputImpl<T>
- java.lang.Object
-
- com.github.akurilov.commons.io.el.ExpressionInputImpl<T>
-
- All Implemented Interfaces:
ExpressionInput<T>,Input<T>,java.lang.AutoCloseable,java.util.concurrent.Callable<T>,java.util.function.Supplier<T>
- Direct Known Subclasses:
SynchronousExpressionInputImpl
public class ExpressionInputImpl<T> extends java.lang.Object implements ExpressionInput<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.akurilov.commons.io.el.ExpressionInput
ExpressionInput.Builder
-
-
Field Summary
-
Fields inherited from interface com.github.akurilov.commons.io.el.ExpressionInput
ASYNC_MARKER, EXPRESSION_PATTERN, FACTORY, INIT_MARKER, SELF_REF_ID, SYNC_MARKER
-
-
Constructor Summary
Constructors Constructor Description ExpressionInputImpl(java.lang.String exprStr, T initial, de.odysseus.el.util.SimpleContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tcall()Perform the expression evaluationvoidclose()java.lang.Stringexpr()Tget()Get a value.intget(java.util.List<T> buffer, int limit)Bulk values get.Tlast()voidreset()Set the last value to the initial one.longskip(long count)Skip some items.java.lang.StringtoString()
-
-
-
Constructor Detail
-
ExpressionInputImpl
public ExpressionInputImpl(java.lang.String exprStr, T initial, de.odysseus.el.util.SimpleContext ctx)
-
-
Method Detail
-
call
public final T call() throws javax.el.PropertyNotFoundException, javax.el.ELException
Description copied from interface:ExpressionInputPerform the expression evaluation- Specified by:
callin interfacejava.util.concurrent.Callable<T>- Specified by:
callin interfaceExpressionInput<T>- Returns:
- the expression evaluation result
- Throws:
javax.el.PropertyNotFoundExceptionjavax.el.ELException
-
last
public final T last()
- Specified by:
lastin interfaceExpressionInput<T>- Returns:
- the result of the last expression evaluation
-
get
public T get() throws javax.el.PropertyNotFoundException, javax.el.ELException
Description copied from interface:ExpressionInputGet a value. A user should invoke call() method by itself to evaluate the expression if the given expression input is not synchronous. The initial value only would be returned otherwise.
-
get
public int get(java.util.List<T> buffer, int limit) throws javax.el.PropertyNotFoundException, javax.el.ELException
Description copied from interface:ExpressionInputBulk values get. A user should invoke call() method by itself to evaluate the expression if the given expression input is not synchronous. The initial value only would be returned otherwise.- Specified by:
getin interfaceExpressionInput<T>- Specified by:
getin interfaceInput<T>- Parameters:
buffer- buffer for the valueslimit- max count of the values to put into the buffer- Returns:
- count of the items have been get and put into the buffer actually
- Throws:
javax.el.PropertyNotFoundExceptionjavax.el.ELException
-
skip
public long skip(long count)
Description copied from interface:ExpressionInputSkip some items.
-
reset
public final void reset()
Description copied from interface:ExpressionInputSet the last value to the initial one.
-
expr
public final java.lang.String expr()
- Specified by:
exprin interfaceExpressionInput<T>- Returns:
- the expression string
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
close
public final void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
-