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 StreamConfigconfig
-
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 StreamBuilderaddTypeHandler(java.lang.Class<?> type, TypeHandler handler)Adds a type handlerStreamBuilderaddTypeHandler(java.lang.String name, java.lang.Class<?> type, TypeHandler handler)Adds a type handlerStreamBuilderaddTypeHandler(java.lang.String name, TypeHandler handler)Adds a type handlerStreamConfigbuild()Builds the stream configuration.StreamBuildercollection(java.lang.Class<?> type)Not supported.StreamBuilderformat(java.lang.String format)Sets the stream format.protected GroupConfiggetConfig()Returns the configuration settings.StreamBuilderignoreUnidentifiedRecords()Indicates unidentified records should be ignored during unmarshalling.protected StreamBuilderme()Returns this.StreamBuilderparser(ParserBuilder parser)Sets the parser for this stream.StreamBuilderparser(RecordParserFactory parser)Sets the parser for this stream.StreamBuilderreadOnly()Indicates this stream configuration is only used for unmarshalling.StreamBuilderresourceBundle(java.lang.String name)StreamBuilderstrict()Indicates this stream should be strictly validated.StreamBuildertype(java.lang.Class<?> type)Not supported.StreamBuilderwriteOnly()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:PropertyBuilderSupportReturns this.- Specified by:
mein classPropertyBuilderSupport<StreamBuilder>- Returns:
- this
-
getConfig
protected GroupConfig getConfig()
Description copied from class:PropertyBuilderSupportReturns the configuration settings.- Specified by:
getConfigin 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:
typein classPropertyBuilderSupport<StreamBuilder>- Parameters:
type- the class- Returns:
- this
-
collection
public StreamBuilder collection(java.lang.Class<?> type)
Not supported.- Overrides:
collectionin classPropertyBuilderSupport<StreamBuilder>- Parameters:
type- theCollectionorMapclass 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
-
-