BeanIO 2.0.4

org.beanio.internal.compiler.json
Class JsonParserFactory

java.lang.Object
  extended by org.beanio.internal.compiler.ProcessorSupport
      extended by org.beanio.internal.compiler.ParserFactorySupport
          extended by org.beanio.internal.compiler.json.JsonParserFactory
All Implemented Interfaces:
ParserFactory

public class JsonParserFactory
extends ParserFactorySupport

A ParserFactory for the JSON stream format.

Since:
2.0
Author:
Kevin Seim

Constructor Summary
JsonParserFactory()
          Constructs a new JsonParserFactory.
 
Method Summary
protected  FieldFormat createFieldFormat(FieldConfig config, Class<?> type)
          Creates a format specific FieldFormat.
protected  Preprocessor createPreprocessor(StreamConfig config)
          Creates a stream configuration pre-processor.
protected  RecordFormat createRecordFormat(RecordConfig config)
          Creates a format specific RecordFormat.
 Stream createStream(StreamConfig config)
          Creates a new stream definition based on a stream configuration.
protected  StreamFormat createStreamFormat(StreamConfig config)
          Creates a format specific StreamFormat.
protected  void finalizeSegmentIteration(SegmentConfig config)
          Called by ParserFactorySupport.finalizeSegment(SegmentConfig) to finalize segment iteration.
protected  void finalizeSegmentMain(SegmentConfig config)
          Called by ParserFactorySupport.finalizeSegment(SegmentConfig) to finalize the segment component.
protected  RecordParserFactory getDefaultRecordParserFactory()
          Returns the default RecordParserFactory.
protected  void initializeSegmentIteration(SegmentConfig config, Property property)
          Called by ParserFactorySupport.initializeSegment(SegmentConfig) to initialize segment iteration.
protected  void initializeSegmentMain(SegmentConfig config, Property property)
          Called by ParserFactorySupport.initializeSegment(SegmentConfig) to initialize the segment.
protected  boolean isSegmentRequired(SegmentConfig config)
           
 
Methods inherited from class org.beanio.internal.compiler.ParserFactorySupport
createAggregation, createProperty, createRecordAggregation, createRecordParserFactory, finalizeGroup, finalizeGroup, finalizeGroupIteration, finalizeGroupMain, finalizeRecord, finalizeRecord, finalizeRecordIteration, finalizeRecordMain, finalizeSegment, finalizeSegment, finalizeStream, getBeanClass, getField, handleConstant, handleField, initializeGroup, initializeGroupIteration, initializeGroupMain, initializeRecord, initializeRecordIteration, initializeRecordMain, initializeSegment, initializeStream, isBound, isReadEnabled, isWriteEnabled, parseDefaultValue, popParser, popProperty, pushParser, pushProperty, reflectCollectionType, reflectPropertyType, setClassLoader, setTypeHandlerFactory, updateConstructor
 
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
 

Constructor Detail

JsonParserFactory

public JsonParserFactory()
Constructs a new JsonParserFactory.

Method Detail

createPreprocessor

protected Preprocessor createPreprocessor(StreamConfig config)
Description copied from class: ParserFactorySupport
Creates a stream configuration pre-processor. May be overridden to return a format specific version.

Overrides:
createPreprocessor in class ParserFactorySupport
Parameters:
config - the stream configuration to pre-process
Returns:
the new Preprocessor

createStream

public Stream createStream(StreamConfig config)
                    throws BeanIOConfigurationException
Description copied from class: ParserFactorySupport
Creates a new stream definition based on a stream configuration.

Specified by:
createStream in interface ParserFactory
Overrides:
createStream in class ParserFactorySupport
Parameters:
config - the stream configuration
Returns:
the new Stream
Throws:
BeanIOConfigurationException - if the configuration is invalid

initializeSegmentIteration

protected void initializeSegmentIteration(SegmentConfig config,
                                          Property property)
Description copied from class: ParserFactorySupport
Called by ParserFactorySupport.initializeSegment(SegmentConfig) to initialize segment iteration.

Overrides:
initializeSegmentIteration in class ParserFactorySupport
Parameters:
config - the segment configuration
property - the Property bound to the segment, or null if no bean was bound

finalizeSegmentIteration

protected void finalizeSegmentIteration(SegmentConfig config)
Description copied from class: ParserFactorySupport
Called by ParserFactorySupport.finalizeSegment(SegmentConfig) to finalize segment iteration.

Overrides:
finalizeSegmentIteration in class ParserFactorySupport
Parameters:
config - the segment configuration

initializeSegmentMain

protected void initializeSegmentMain(SegmentConfig config,
                                     Property property)
Description copied from class: ParserFactorySupport
Called by ParserFactorySupport.initializeSegment(SegmentConfig) to initialize the segment.

Overrides:
initializeSegmentMain in class ParserFactorySupport
Parameters:
config - the segment configuration
property - the property bound to the segment, or null if no property was bound

finalizeSegmentMain

protected void finalizeSegmentMain(SegmentConfig config)
                            throws BeanIOConfigurationException
Description copied from class: ParserFactorySupport
Called by ParserFactorySupport.finalizeSegment(SegmentConfig) to finalize the segment component.

Overrides:
finalizeSegmentMain in class ParserFactorySupport
Parameters:
config - the segment configuration
Throws:
BeanIOConfigurationException

isSegmentRequired

protected boolean isSegmentRequired(SegmentConfig config)
Overrides:
isSegmentRequired in class ParserFactorySupport

createStreamFormat

protected StreamFormat createStreamFormat(StreamConfig config)
Description copied from class: ParserFactorySupport
Creates a format specific StreamFormat.

Specified by:
createStreamFormat in class ParserFactorySupport
Parameters:
config - the stream configuration
Returns:
the new StreamFormat

createRecordFormat

protected RecordFormat createRecordFormat(RecordConfig config)
Description copied from class: ParserFactorySupport
Creates a format specific RecordFormat.

Specified by:
createRecordFormat in class ParserFactorySupport
Parameters:
config - the record configuration
Returns:
the new RecordFormat

createFieldFormat

protected FieldFormat createFieldFormat(FieldConfig config,
                                        Class<?> type)
Description copied from class: ParserFactorySupport
Creates a format specific FieldFormat.

Specified by:
createFieldFormat in class ParserFactorySupport
Parameters:
config - the field configuration
type - the property type, or null if not bound to a property
Returns:
the new FieldFormat

getDefaultRecordParserFactory

protected RecordParserFactory getDefaultRecordParserFactory()
Description copied from class: ParserFactorySupport
Returns the default RecordParserFactory.

Specified by:
getDefaultRecordParserFactory in class ParserFactorySupport
Returns:
the RecordParserFactory

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim