Package org.beanio.builder
Class StreamBuilder
- java.lang.Object
-
- org.beanio.builder.PropertyBuilderSupport<T>
-
- org.beanio.builder.GroupBuilderSupport<StreamBuilder>
-
- org.beanio.builder.StreamBuilder
-
public class StreamBuilder extends GroupBuilderSupport<StreamBuilder>
Builds a new stream configuration.- Since:
- 2.1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected StreamConfig
config
-
Constructor Summary
Constructors Constructor Description StreamBuilder(java.lang.String name)
Constructs a new StreamBuilder.StreamBuilder(java.lang.String name, java.lang.String format)
Constructs a new StreamBuilder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StreamBuilder
addTypeHandler(java.lang.Class<?> type, TypeHandler handler)
Adds a type handlerStreamBuilder
addTypeHandler(java.lang.String name, java.lang.Class<?> type, TypeHandler handler)
Adds a type handlerStreamBuilder
addTypeHandler(java.lang.String name, TypeHandler handler)
Adds a type handlerStreamConfig
build()
Builds the stream configuration.StreamBuilder
collection(java.lang.Class<?> type)
Not supported.StreamBuilder
format(java.lang.String format)
Sets the stream format.protected GroupConfig
getConfig()
Returns the configuration settings.StreamBuilder
ignoreUnidentifiedRecords()
Indicates unidentified records should be ignored during unmarshalling.protected StreamBuilder
me()
Returns this.StreamBuilder
parser(ParserBuilder parser)
Sets the parser for this stream.StreamBuilder
parser(RecordParserFactory parser)
Sets the parser for this stream.StreamBuilder
readOnly()
Indicates this stream configuration is only used for unmarshalling.StreamBuilder
resourceBundle(java.lang.String name)
StreamBuilder
strict()
Indicates this stream should be strictly validated.StreamBuilder
type(java.lang.Class<?> type)
Not supported.StreamBuilder
writeOnly()
Indicates this stream configuration is only used for marshalling.-
Methods inherited from class org.beanio.builder.GroupBuilderSupport
addGroup, addGroup, addRecord, addRecord
-
-
-
-
Field Detail
-
config
protected StreamConfig config
-
-
Constructor Detail
-
StreamBuilder
public StreamBuilder(java.lang.String name)
Constructs a new StreamBuilder.- Parameters:
name
- the stream name
-
StreamBuilder
public StreamBuilder(java.lang.String name, java.lang.String format)
Constructs a new StreamBuilder.- Parameters:
name
- the stream nameformat
- the stream format
-
-
Method Detail
-
me
protected StreamBuilder me()
Description copied from class:PropertyBuilderSupport
Returns this.- Specified by:
me
in classPropertyBuilderSupport<StreamBuilder>
- Returns:
- this
-
getConfig
protected GroupConfig getConfig()
Description copied from class:PropertyBuilderSupport
Returns the configuration settings.- Specified by:
getConfig
in classGroupBuilderSupport<StreamBuilder>
- Returns:
- the configuration
-
format
public StreamBuilder format(java.lang.String format)
Sets the stream format.- Parameters:
format
- the format (e.g. csv, delimited, fixedlength, xml)- Returns:
- this
-
parser
public StreamBuilder parser(RecordParserFactory parser)
Sets the parser for this stream.- Parameters:
parser
- the stream parser factory- Returns:
- this
-
parser
public StreamBuilder parser(ParserBuilder parser)
Sets the parser for this stream.- Parameters:
parser
- theParserBuilder
- Returns:
- this
-
addTypeHandler
public StreamBuilder addTypeHandler(java.lang.String name, java.lang.Class<?> type, TypeHandler handler)
Adds a type handler- Parameters:
name
- the name of the type handlertype
- the class parsed by the type handlerhandler
- the type handler- Returns:
- this
-
addTypeHandler
public StreamBuilder addTypeHandler(java.lang.String name, TypeHandler handler)
Adds a type handler- Parameters:
name
- the name of the type handlerhandler
- the type handler- Returns:
- this
-
addTypeHandler
public StreamBuilder addTypeHandler(java.lang.Class<?> type, TypeHandler handler)
Adds a type handler- Parameters:
type
- the class parsed by the type handlerhandler
- the type handler- Returns:
- this
-
type
public StreamBuilder type(java.lang.Class<?> type)
Not supported.- Overrides:
type
in classPropertyBuilderSupport<StreamBuilder>
- Parameters:
type
- the class- Returns:
- this
-
collection
public StreamBuilder collection(java.lang.Class<?> type)
Not supported.- Overrides:
collection
in classPropertyBuilderSupport<StreamBuilder>
- Parameters:
type
- theCollection
orMap
class or subclass- Returns:
- this
-
readOnly
public StreamBuilder readOnly()
Indicates this stream configuration is only used for unmarshalling.- Returns:
- this
-
writeOnly
public StreamBuilder writeOnly()
Indicates this stream configuration is only used for marshalling.- Returns:
- this
-
resourceBundle
public StreamBuilder resourceBundle(java.lang.String name)
-
strict
public StreamBuilder strict()
Indicates this stream should be strictly validated.- Returns:
- this
-
ignoreUnidentifiedRecords
public StreamBuilder ignoreUnidentifiedRecords()
Indicates unidentified records should be ignored during unmarshalling.- Returns:
- this
-
build
public StreamConfig build()
Builds the stream configuration.- Returns:
- the stream configuration
-
-