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.Object
Used 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 T
createDefaultValue()
Called when initialized to return a default value.T
get(ParsingContext context)
Gets the value.void
init(int index, ParsingContext context)
Initializes the variable.void
set(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
- theParsingContext
being initialized
-
get
public final T get(ParsingContext context)
Gets the value.- Parameters:
context
- theParsingContext
to get the value from- Returns:
- the value
-
set
public final void set(ParsingContext context, T obj)
Sets the value.- Parameters:
context
- theParsingContext
to set the value onobj
- the value
-
-