BeanIO 2.0.4

org.beanio.internal.parser
Class ParsingContext

java.lang.Object
  extended by org.beanio.internal.parser.ParsingContext
Direct Known Subclasses:
MarshallingContext, UnmarshallingContext

public abstract class ParsingContext
extends Object

Base class for the parsing context- marshalling or unmarshaling.

Since:
2.0
Author:
Kevin Seim

Field Summary
static char MARSHALLING
          Marsalling mode
static char UNMARSHALLING
          Unmarshalling mode
 
Constructor Summary
ParsingContext()
          Constructs a new ParsingContext.
 
Method Summary
 void createHeap(int size)
           
 int getAdjustedFieldPosition(int position)
          Calculates a field position by adjusting for any applied iterations.
 Object getLocal(int index)
           
abstract  char getMode()
          Returns the parsing mode.
 int getRelativeFieldIndex()
          Returns the current field index relative to any current iteration.
 boolean isRepeating()
          Returns whether a repeating segment or field is being parsed.
 Iteration popIteration()
          Pops the last Iteration pushed onto the stack.
 void pushIteration(Iteration iteration)
          Pushes an Iteration onto a stack for adjusting field positions and indices.
 void setLocal(int index, Object obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNMARSHALLING

public static final char UNMARSHALLING
Unmarshalling mode

See Also:
Constant Field Values

MARSHALLING

public static final char MARSHALLING
Marsalling mode

See Also:
Constant Field Values
Constructor Detail

ParsingContext

public ParsingContext()
Constructs a new ParsingContext.

Method Detail

getMode

public abstract char getMode()
Returns the parsing mode.

Returns:
either UNMARSHALLING or MARSHALLING

pushIteration

public void pushIteration(Iteration iteration)
Pushes an Iteration onto a stack for adjusting field positions and indices.

Parameters:
iteration - the Iteration to push
See Also:
popIteration()

popIteration

public Iteration popIteration()
Pops the last Iteration pushed onto the stack.

See Also:
pushIteration(Iteration)

getAdjustedFieldPosition

public final int getAdjustedFieldPosition(int position)
Calculates a field position by adjusting for any applied iterations.

Parameters:
position - the field position to adjust (i.e. the position of the first occurrence of the field)
Returns:
the adjusted field position

getRelativeFieldIndex

public final int getRelativeFieldIndex()
Returns the current field index relative to any current iteration.

Returns:
the field index

isRepeating

public final boolean isRepeating()
Returns whether a repeating segment or field is being parsed.

Returns:
true if repeating, false otherwise

createHeap

public final void createHeap(int size)

getLocal

public final Object getLocal(int index)

setLocal

public final void setLocal(int index,
                           Object obj)

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim