BeanIO 2.0.4

org.beanio.internal.parser
Class ParserLocal<T>

java.lang.Object
  extended by org.beanio.internal.parser.ParserLocal<T>
Type Parameters:
T - the variable type

public class ParserLocal<T>
extends Object

Used to create a reference to a variable held by a ParsingContext.

Author:
Kevin Seim

Constructor Summary
ParserLocal()
          Constructs a new ParserLocal.
ParserLocal(T defaultValue)
          Constructs a new ParserLocal.
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParserLocal

public ParserLocal()
Constructs a new ParserLocal.


ParserLocal

public ParserLocal(T defaultValue)
Constructs a new ParserLocal.

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 heap
context - the ParsingContext being initialized

get

public final T get(ParsingContext context)
Gets the value.

Parameters:
context - the ParsingContext to get the value from
Returns:
the value

set

public final void set(ParsingContext context,
                      T obj)
Sets the value.

Parameters:
context - the ParsingContext to set the value on
obj - the value

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim