BeanIO 2.0.4

org.beanio.internal.compiler
Class Preprocessor

java.lang.Object
  extended by org.beanio.internal.compiler.ProcessorSupport
      extended by org.beanio.internal.compiler.Preprocessor
Direct Known Subclasses:
FlatPreprocessor, JsonPreprocessor, XmlPreprocessor

public class Preprocessor
extends ProcessorSupport

A Preprocesser is responsible for validating a stream configuration, setting default configuration values, and populating any calculated values before the ParserFactorySupport compiles the configuration into parser components.

Since:
2.0
Author:
Kevin Seim

Field Summary
protected  PropertyConfig propertyRoot
           
protected  StreamConfig stream
           
 
Constructor Summary
Preprocessor(StreamConfig stream)
          Constructs a new Preprocessor.
 
Method Summary
protected  void finalizeGroup(GroupConfig group)
          Finalizes a group configuration after its children have been processed.
protected  void finalizeRecord(RecordConfig record)
          Finalizes a record configuration after its children have been processed.
protected  void finalizeSegment(SegmentConfig segment)
          Finalizes a segment configuration after its children have been processed.
protected  void finalizeStream(StreamConfig stream)
          Finalizes a stream configuration after its children have been processed.
protected  void handleConstant(ConstantConfig constant)
          Processes a constant configuration.
protected  void handleField(FieldConfig field)
          Processes a field configuration.
protected  void initializeGroup(GroupConfig group)
          Initializes a group configuration before its children have been processed.
protected  void initializeRecord(RecordConfig record)
          Initializes a record configuration before its children have been processed.
protected  void initializeSegment(SegmentConfig segment)
          Initializes a segment configuration before its children have been processed.
protected  void initializeStream(StreamConfig stream)
          Initializes a stream configuration before its children have been processed.
protected  void validateRecordIdentifyingCriteria(FieldConfig field)
          This method validates a record identifying field has a literal or regular expression configured for identifying a record.
 
Methods inherited from class org.beanio.internal.compiler.ProcessorSupport
getParent, handleComponent, process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stream

protected StreamConfig stream

propertyRoot

protected PropertyConfig propertyRoot
Constructor Detail

Preprocessor

public Preprocessor(StreamConfig stream)
Constructs a new Preprocessor.

Parameters:
stream - the stream configuration to preprocess
Method Detail

initializeStream

protected void initializeStream(StreamConfig stream)
                         throws BeanIOConfigurationException
Initializes a stream configuration before its children have been processed.

Overrides:
initializeStream in class ProcessorSupport
Parameters:
stream - the stream configuration to process
Throws:
BeanIOConfigurationException

finalizeStream

protected void finalizeStream(StreamConfig stream)
                       throws BeanIOConfigurationException
Finalizes a stream configuration after its children have been processed.

Overrides:
finalizeStream in class ProcessorSupport
Parameters:
stream - the stream configuration to finalize
Throws:
BeanIOConfigurationException

initializeGroup

protected void initializeGroup(GroupConfig group)
                        throws BeanIOConfigurationException
Initializes a group configuration before its children have been processed.

Overrides:
initializeGroup in class ProcessorSupport
Parameters:
group - the group configuration to process
Throws:
BeanIOConfigurationException

finalizeGroup

protected void finalizeGroup(GroupConfig group)
                      throws BeanIOConfigurationException
Finalizes a group configuration after its children have been processed.

Overrides:
finalizeGroup in class ProcessorSupport
Parameters:
group - the group configuration to finalize
Throws:
BeanIOConfigurationException

initializeRecord

protected void initializeRecord(RecordConfig record)
                         throws BeanIOConfigurationException
Initializes a record configuration before its children have been processed.

Overrides:
initializeRecord in class ProcessorSupport
Parameters:
record - the record configuration to process
Throws:
BeanIOConfigurationException

finalizeRecord

protected void finalizeRecord(RecordConfig record)
                       throws BeanIOConfigurationException
Finalizes a record configuration after its children have been processed.

Overrides:
finalizeRecord in class ProcessorSupport
Parameters:
record - the record configuration to process
Throws:
BeanIOConfigurationException

initializeSegment

protected void initializeSegment(SegmentConfig segment)
                          throws BeanIOConfigurationException
Initializes a segment configuration before its children have been processed.

Overrides:
initializeSegment in class ProcessorSupport
Parameters:
segment - the segment configuration to process
Throws:
BeanIOConfigurationException

finalizeSegment

protected void finalizeSegment(SegmentConfig segment)
                        throws BeanIOConfigurationException
Finalizes a segment configuration after its children have been processed.

Overrides:
finalizeSegment in class ProcessorSupport
Parameters:
segment - the segment configuration to process
Throws:
BeanIOConfigurationException

handleField

protected void handleField(FieldConfig field)
                    throws BeanIOConfigurationException
Processes a field configuration.

Overrides:
handleField in class ProcessorSupport
Parameters:
field - the field configuration to process
Throws:
BeanIOConfigurationException

handleConstant

protected void handleConstant(ConstantConfig constant)
                       throws BeanIOConfigurationException
Processes a constant configuration.

Overrides:
handleConstant in class ProcessorSupport
Parameters:
constant - the constant configuration to process
Throws:
BeanIOConfigurationException

validateRecordIdentifyingCriteria

protected void validateRecordIdentifyingCriteria(FieldConfig field)
                                          throws BeanIOConfigurationException
This method validates a record identifying field has a literal or regular expression configured for identifying a record.

Parameters:
field - the record identifying field configuration to validate
Throws:
BeanIOConfigurationException

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim