Package org.beanio.internal.compiler
Class Preprocessor
- java.lang.Object
-
- org.beanio.internal.compiler.ProcessorSupport
-
- 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 theParserFactorySupport
compiles the configuration into parser components.- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description protected PropertyConfig
propertyRoot
protected StreamConfig
stream
-
Constructor Summary
Constructors Constructor Description Preprocessor(StreamConfig stream)
Constructs a newPreprocessor
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
-
Field Detail
-
stream
protected StreamConfig stream
-
propertyRoot
protected PropertyConfig propertyRoot
-
-
Constructor Detail
-
Preprocessor
public Preprocessor(StreamConfig stream)
Constructs a newPreprocessor
.- 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 classProcessorSupport
- 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 classProcessorSupport
- 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 classProcessorSupport
- 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 classProcessorSupport
- 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 classProcessorSupport
- 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 classProcessorSupport
- 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 classProcessorSupport
- 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 classProcessorSupport
- Parameters:
segment
- the segment configuration to process- Throws:
BeanIOConfigurationException
-
handleField
protected void handleField(FieldConfig field) throws BeanIOConfigurationException
Processes a field configuration.- Overrides:
handleField
in classProcessorSupport
- Parameters:
field
- the field configuration to process- Throws:
BeanIOConfigurationException
-
handleConstant
protected void handleConstant(ConstantConfig constant) throws BeanIOConfigurationException
Processes a constant configuration.- Overrides:
handleConstant
in classProcessorSupport
- 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
-
-