Package org.beanio.internal.parser
Class ParserLocal<T>
- java.lang.Object
-
- org.beanio.internal.parser.ParserLocal<T>
-
- Type Parameters:
T- the variable type
public class ParserLocal<T> extends java.lang.ObjectUsed to create a reference to a variable held by aParsingContext.
-
-
Constructor Summary
Constructors Constructor Description ParserLocal()Constructs a newParserLocal.ParserLocal(T defaultValue)Constructs a newParserLocal.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TcreateDefaultValue()Called when initialized to return a default value.Tget(ParsingContext context)Gets the value.voidinit(int index, ParsingContext context)Initializes the variable.voidset(ParsingContext context, T obj)Sets the value.
-
-
-
Constructor Detail
-
ParserLocal
public ParserLocal()
Constructs a newParserLocal.
-
ParserLocal
public ParserLocal(T defaultValue)
Constructs a newParserLocal.- Parameters:
defaultValue- the default value
-
-
Method Detail
-
createDefaultValue
protected T createDefaultValue()
Called when initialized to return a default value. If not overridden, it returns the default value passed via the constructor.- Returns:
- the default value
-
init
public final void init(int index, ParsingContext context)Initializes the variable.- Parameters:
index- the index of the variable in the heapcontext- theParsingContextbeing initialized
-
get
public final T get(ParsingContext context)
Gets the value.- Parameters:
context- theParsingContextto get the value from- Returns:
- the value
-
set
public final void set(ParsingContext context, T obj)
Sets the value.- Parameters:
context- theParsingContextto set the value onobj- the value
-
-