BeanIO 1.2.3

org.beanio.config.xml
Class XmlStreamDefinitionFactory

java.lang.Object
  extended by org.beanio.config.StreamDefinitionFactory
      extended by org.beanio.config.xml.XmlStreamDefinitionFactory

public class XmlStreamDefinitionFactory
extends StreamDefinitionFactory

A XmlStreamDefinitionFactory is used to create stream definitions for XML formatted streams from a BeanIO mapping configuration.

Since:
1.1
Author:
Kevin Seim

Constructor Summary
XmlStreamDefinitionFactory()
           
 
Method Summary
protected  void compileRecordDefinition(GroupDefinition group, RecordConfig config, RecordDefinition recordDefinition)
          Compiles a record definition from its configuration.
 TypeHandlerFactory getDefaultTypeHandlerFactory()
          Returns the type handler factory for this stream format, thus allowing a stream format to override default type handlers.
protected  boolean isOptionalBeanEnabled()
          Returns whether this stream format allows beans with zero minimum occurrences.
protected  boolean isOptionalFieldEnabled()
          Returns whether this stream format allows fields with zero minimum occurrences.
protected  BeanDefinition newBeanDefinition(BeanConfig bean)
          Creates a new BeanDefinition.
protected  FieldDefinition newFieldDefinition(FieldConfig field)
          Creates a new FieldDefinition.
protected  GroupDefinition newGroupDefinition(GroupConfig group)
          Creates a new GroupDefinition.
protected  RecordDefinition newRecordDefinition(RecordConfig record)
          Creates a new RecordDefinition.
protected  RecordReaderFactory newRecordReaderFactory()
          Creates a default record reader factory.
protected  RecordWriterFactory newRecordWriterFactory()
          Creates a default record writer factory
protected  StreamDefinition newStreamDefinition(StreamConfig stream)
          Creates a new StreamDefinition.
protected  void updateBeanDefinition(BeanConfig beanConfig, BeanDefinition beanDefinition)
          This method is called by compileBeanDefinition to allow the configuration of format specific bean configuration settings.
protected  void updateFieldDefinition(FieldConfig fieldConfig, FieldDefinition fieldDefinition)
          This method is called by compileFieldDefinitions to allow the configuration of format specific field configuration settings.
protected  void updateGroupDefinition(GroupDefinition parent, GroupConfig config, GroupDefinition definition)
          This method is called by compileGroupDefinition to allow the configuration of stream specific group configuration settings.
protected  void validateRecordIdentifyingCriteria(FieldDefinition fieldDefinition)
          An XML record identifying field of type element or attribute does not need a literal or regular expression configured to identify the record (since the presence of the named field may sufficiently identify the record).
 
Methods inherited from class org.beanio.config.StreamDefinitionFactory
compileBeanDefinition, compileBeanPropertyDefinition, compileFieldDefinition, compileFieldDefinitions, compileFieldDefinitions, compileGroupDefinition, compileStreamDefinition, createStreamDefinition, getBeanClass, isReadEnabled, isWriteEnabled, setTypeHandlerFactory, updateStreamDefinition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlStreamDefinitionFactory

public XmlStreamDefinitionFactory()
Method Detail

getDefaultTypeHandlerFactory

public TypeHandlerFactory getDefaultTypeHandlerFactory()
Description copied from class: StreamDefinitionFactory
Returns the type handler factory for this stream format, thus allowing a stream format to override default type handlers.

Overrides:
getDefaultTypeHandlerFactory in class StreamDefinitionFactory
Returns:
the type handler factory

isOptionalFieldEnabled

protected boolean isOptionalFieldEnabled()
Description copied from class: StreamDefinitionFactory
Returns whether this stream format allows fields with zero minimum occurrences. Returns false by default.

Overrides:
isOptionalFieldEnabled in class StreamDefinitionFactory
Returns:
true if the stream format allows optional fields

isOptionalBeanEnabled

protected boolean isOptionalBeanEnabled()
Description copied from class: StreamDefinitionFactory
Returns whether this stream format allows beans with zero minimum occurrences. Returns false by default.

Overrides:
isOptionalBeanEnabled in class StreamDefinitionFactory
Returns:
true if the stream format allows optional beans

updateGroupDefinition

protected void updateGroupDefinition(GroupDefinition parent,
                                     GroupConfig config,
                                     GroupDefinition definition)
Description copied from class: StreamDefinitionFactory
This method is called by compileGroupDefinition to allow the configuration of stream specific group configuration settings.

Overrides:
updateGroupDefinition in class StreamDefinitionFactory
Parameters:
parent - the parent group definition
config - the group configuration
definition - the group definition

compileRecordDefinition

protected void compileRecordDefinition(GroupDefinition group,
                                       RecordConfig config,
                                       RecordDefinition recordDefinition)
Description copied from class: StreamDefinitionFactory
Compiles a record definition from its configuration.

Overrides:
compileRecordDefinition in class StreamDefinitionFactory
config - the record configuration
recordDefinition - the record definition

updateBeanDefinition

protected void updateBeanDefinition(BeanConfig beanConfig,
                                    BeanDefinition beanDefinition)
Description copied from class: StreamDefinitionFactory
This method is called by compileBeanDefinition to allow the configuration of format specific bean configuration settings.

Overrides:
updateBeanDefinition in class StreamDefinitionFactory
Parameters:
beanConfig - the bean configuration
beanDefinition - the bean definition

updateFieldDefinition

protected void updateFieldDefinition(FieldConfig fieldConfig,
                                     FieldDefinition fieldDefinition)
Description copied from class: StreamDefinitionFactory
This method is called by compileFieldDefinitions to allow the configuration of format specific field configuration settings.

Overrides:
updateFieldDefinition in class StreamDefinitionFactory
Parameters:
fieldConfig - the field configuration
fieldDefinition - the field definition

validateRecordIdentifyingCriteria

protected void validateRecordIdentifyingCriteria(FieldDefinition fieldDefinition)
An XML record identifying field of type element or attribute does not need a literal or regular expression configured to identify the record (since the presence of the named field may sufficiently identify the record).

Overrides:
validateRecordIdentifyingCriteria in class StreamDefinitionFactory
Parameters:
fieldDefinition - the record identifying field definition to validate

newGroupDefinition

protected GroupDefinition newGroupDefinition(GroupConfig group)
Description copied from class: StreamDefinitionFactory
Creates a new GroupDefinition.

Overrides:
newGroupDefinition in class StreamDefinitionFactory
Parameters:
group - the group configuration
Returns:
the new GroupDefinition

newFieldDefinition

protected FieldDefinition newFieldDefinition(FieldConfig field)
Description copied from class: StreamDefinitionFactory
Creates a new FieldDefinition.

Specified by:
newFieldDefinition in class StreamDefinitionFactory
Parameters:
field - the field configuration
Returns:
the new FieldDefinition

newBeanDefinition

protected BeanDefinition newBeanDefinition(BeanConfig bean)
Description copied from class: StreamDefinitionFactory
Creates a new BeanDefinition.

Specified by:
newBeanDefinition in class StreamDefinitionFactory
Parameters:
bean - the bean configuration
Returns:
the new BeanDefinition

newRecordDefinition

protected RecordDefinition newRecordDefinition(RecordConfig record)
Description copied from class: StreamDefinitionFactory
Creates a new RecordDefinition.

Specified by:
newRecordDefinition in class StreamDefinitionFactory
Parameters:
record - the record configuration
Returns:
the new RecordDefinition

newStreamDefinition

protected StreamDefinition newStreamDefinition(StreamConfig stream)
Description copied from class: StreamDefinitionFactory
Creates a new StreamDefinition.

Specified by:
newStreamDefinition in class StreamDefinitionFactory
Parameters:
stream - the stream configuration
Returns:
the new StreamDefinition

newRecordReaderFactory

protected RecordReaderFactory newRecordReaderFactory()
Description copied from class: StreamDefinitionFactory
Creates a default record reader factory.

Specified by:
newRecordReaderFactory in class StreamDefinitionFactory
Returns:
the new RecordReaderFactory

newRecordWriterFactory

protected RecordWriterFactory newRecordWriterFactory()
Description copied from class: StreamDefinitionFactory
Creates a default record writer factory

Specified by:
newRecordWriterFactory in class StreamDefinitionFactory
Returns:
the new RecordWriterFactory

BeanIO 1.2.3

Copyright © 2010-2012 Kevin Seim