|
BeanIO 1.2.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.beanio.config.StreamDefinitionFactory
public abstract class StreamDefinitionFactory
A StreamDefinitionFactory is used to convert a stream configuration into a StreamDefinition for parsing an I/O stream.
| Constructor Summary | |
|---|---|
StreamDefinitionFactory()
Constructs a new StreamDefinitionFactory. |
|
| Method Summary | |
|---|---|
protected void |
compileBeanDefinition(BeanDefinition parent,
BeanConfig config,
BeanDefinition definition)
Compiles a bean definition. |
protected void |
compileBeanPropertyDefinition(BeanDefinition beanDefinition,
BeanPropertyConfig config,
BeanPropertyDefinition definition)
Compiles a bean property definition. |
protected void |
compileFieldDefinition(BeanDefinition beanDefinition,
FieldConfig field,
FieldDefinition fieldDefinition)
Compiles a field definition. |
protected void |
compileFieldDefinitions(BeanConfig beanConfig,
BeanDefinition beanDefinition)
Compiles child property definitions for a bean. |
protected void |
compileFieldDefinitions(RecordConfig recordConfig,
RecordDefinition recordDefinition)
Compiles child property definitions for a record. |
protected void |
compileGroupDefinition(StreamConfig streamConfig,
GroupConfig groupConfig,
GroupDefinition definition)
Compiles a group definition from its configuration. |
protected void |
compileRecordDefinition(GroupDefinition group,
RecordConfig config,
RecordDefinition recordDefinition)
Compiles a record definition from its configuration. |
protected void |
compileStreamDefinition(StreamConfig config,
StreamDefinition definition)
Compiles a stream definition from its configuration. |
StreamDefinition |
createStreamDefinition(StreamConfig config)
Creates a new stream definition based on a stream configuration. |
protected Class<?> |
getBeanClass(BeanConfig config)
Determines the bean class type 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. |
boolean |
isReadEnabled()
Returns whether the stream definition must support reading an input stream. |
boolean |
isWriteEnabled()
Returns whether the stream definition must support writing to an output stream. |
protected abstract BeanDefinition |
newBeanDefinition(BeanConfig bean)
Creates a new BeanDefinition. |
protected abstract FieldDefinition |
newFieldDefinition(FieldConfig field)
Creates a new FieldDefinition. |
protected GroupDefinition |
newGroupDefinition(GroupConfig group)
Creates a new GroupDefinition. |
protected abstract RecordDefinition |
newRecordDefinition(RecordConfig record)
Creates a new RecordDefinition. |
protected abstract RecordReaderFactory |
newRecordReaderFactory()
Creates a default record reader factory. |
protected abstract RecordWriterFactory |
newRecordWriterFactory()
Creates a default record writer factory |
protected abstract StreamDefinition |
newStreamDefinition(StreamConfig stream)
Creates a new StreamDefinition. |
void |
setTypeHandlerFactory(TypeHandlerFactory typeHandlerFactory)
Sets the type handler factory to use to create the stream definition. |
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 |
updateStreamDefinition(StreamConfig config,
StreamDefinition definition)
This method is called by compileStreamDefinition to allow the configuration of stream specific stream configuration settings. |
protected void |
validateRecordIdentifyingCriteria(FieldDefinition fieldDefinition)
This method validates a record identifying field has a literal or regular expression configured for identifying a record. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StreamDefinitionFactory()
| Method Detail |
|---|
public StreamDefinition createStreamDefinition(StreamConfig config)
throws BeanIOConfigurationException
config - the stream configuration
BeanIOConfigurationException - if the configuration is invalid
protected void compileStreamDefinition(StreamConfig config,
StreamDefinition definition)
throws BeanIOConfigurationException
config - the stream configurationdefinition - the stream definition to compile
BeanIOConfigurationException - if the configuration is invalid
protected void updateStreamDefinition(StreamConfig config,
StreamDefinition definition)
config - the stream configurationdefinition - the stream definition
protected final void compileGroupDefinition(StreamConfig streamConfig,
GroupConfig groupConfig,
GroupDefinition definition)
streamConfig - the parent stream configurationgroupConfig - the group configurationdefinition - the group definition to compile
protected void updateGroupDefinition(GroupDefinition parent,
GroupConfig config,
GroupDefinition definition)
parent - the parent group definitionconfig - the group configurationdefinition - the group definition
protected void compileRecordDefinition(GroupDefinition group,
RecordConfig config,
RecordDefinition recordDefinition)
config - the record configurationrecordDefinition - the record definition
protected void compileBeanDefinition(BeanDefinition parent,
BeanConfig config,
BeanDefinition definition)
config - the bean configurationdefinition - the bean definition to updateprotected boolean isOptionalBeanEnabled()
protected void updateBeanDefinition(BeanConfig beanConfig,
BeanDefinition beanDefinition)
beanConfig - the bean configurationbeanDefinition - the bean definition
protected void compileFieldDefinitions(RecordConfig recordConfig,
RecordDefinition recordDefinition)
recordConfig - the record configurationrecordDefinition - the record definition to update
protected void compileFieldDefinitions(BeanConfig beanConfig,
BeanDefinition beanDefinition)
beanConfig - the bean configurationbeanDefinition - the bean definition to update
protected void compileBeanPropertyDefinition(BeanDefinition beanDefinition,
BeanPropertyConfig config,
BeanPropertyDefinition definition)
beanDefinition - the parent bean definitionconfig - the property configurationdefinition - the property definition
protected void compileFieldDefinition(BeanDefinition beanDefinition,
FieldConfig field,
FieldDefinition fieldDefinition)
beanDefinition - the parent bean definitionfield - the field configurationfieldDefinition - the field definition
protected void updateFieldDefinition(FieldConfig fieldConfig,
FieldDefinition fieldDefinition)
fieldConfig - the field configurationfieldDefinition - the field definitionprotected void validateRecordIdentifyingCriteria(FieldDefinition fieldDefinition)
fieldDefinition - the record identifying field definition to validateprotected boolean isOptionalFieldEnabled()
protected Class<?> getBeanClass(BeanConfig config)
config - the bean configuration
protected abstract FieldDefinition newFieldDefinition(FieldConfig field)
field - the field configuration
protected abstract BeanDefinition newBeanDefinition(BeanConfig bean)
bean - the bean configuration
protected abstract RecordDefinition newRecordDefinition(RecordConfig record)
record - the record configuration
protected GroupDefinition newGroupDefinition(GroupConfig group)
group - the group configuration
protected abstract StreamDefinition newStreamDefinition(StreamConfig stream)
stream - the stream configuration
protected abstract RecordReaderFactory newRecordReaderFactory()
protected abstract RecordWriterFactory newRecordWriterFactory()
public void setTypeHandlerFactory(TypeHandlerFactory typeHandlerFactory)
typeHandlerFactory - the TypeHandlerFactory to use to
create the stream definitionpublic TypeHandlerFactory getDefaultTypeHandlerFactory()
public boolean isReadEnabled()
public boolean isWriteEnabled()
|
BeanIO 1.2.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||