BeanIO 1.2.3

org.beanio.config
Class StreamConfig

java.lang.Object
  extended by org.beanio.config.StreamConfig

public class StreamConfig
extends Object

Stores configuration settings for a stream.

Since:
1.0
Author:
Kevin Seim

Field Summary
static String READ_ONLY_MODE
          Stream configuration supports reading only
static String READ_WRITE_MODE
          Stream configuration supports reading and writing
static String WRITE_ONLY_MODE
          Stream configuration supports writing only
 
Constructor Summary
StreamConfig()
          Constructs a new StreamConfig.
 
Method Summary
 void addHandler(TypeHandlerConfig handler)
          Adds a custom type handler to this stream.
 void addNode(NodeConfig node)
          Adds a record or group to this stream's root group.
 String getFormat()
          Returns the format of this stream.
 List<TypeHandlerConfig> getHandlerList()
          Returns a list of customized type handlers configured for this stream.
 String getMode()
          Returns the allowed mode(s) of operation for this stream configuration.
 String getName()
          Returns the name of this stream.
 List<NodeConfig> getNodeList()
          Returns the list of child nodes (records and groups) for this stream.
 Bean getReaderFactory()
          Returns the record reader factory configuration bean.
 String getResourceBundle()
          Returns the path name of the resource bundle containing customized error messages for this stream.
 GroupConfig getRootGroupConfig()
          Returns the root group.
 Bean getWriterFactory()
          Returns the record writer factory configuration bean.
 boolean isOrdered()
          Returns whether stream components (records and groups) are ordered.
 void setFormat(String format)
          Sets the format of this stream.
 void setMaxOccurs(int maxOccurs)
          Sets the maximum occurrences of this stream.
 void setMinOccurs(int minOccurs)
          Sets the minimum occurrences of this stream.
 void setMode(String mode)
          Sets the allowed mode(s) of operation for this stream configuration.
 void setName(String name)
          Sets the name of this stream.
 void setNodeList(List<NodeConfig> nodeList)
          Sets the list of child nodes for this stream.
 void setOrdered(boolean ordered)
          Sets whether stream components (records and groups) are ordered.
 void setReaderFactory(Bean readerFactory)
          Sets the record reader factory configuration bean.
 void setResourceBundle(String resourceBundle)
          Sets the path name of the resource bundle containing customized error messages for this stream.
 void setWriterFactory(Bean writerFactory)
          Sets the record writer factory configuration bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READ_WRITE_MODE

public static final String READ_WRITE_MODE
Stream configuration supports reading and writing

See Also:
Constant Field Values

READ_ONLY_MODE

public static final String READ_ONLY_MODE
Stream configuration supports reading only

See Also:
Constant Field Values

WRITE_ONLY_MODE

public static final String WRITE_ONLY_MODE
Stream configuration supports writing only

See Also:
Constant Field Values
Constructor Detail

StreamConfig

public StreamConfig()
Constructs a new StreamConfig.

Method Detail

getName

public String getName()
Returns the name of this stream.

Returns:
the stream name

setName

public void setName(String name)
Sets the name of this stream.

Parameters:
name - the stream name

getFormat

public String getFormat()
Returns the format of this stream.

Returns:
the stream format

setFormat

public void setFormat(String format)
Sets the format of this stream.

Parameters:
format - the stream format

getMode

public String getMode()
Returns the allowed mode(s) of operation for this stream configuration.

Returns:
READ_WRITE_MODE if reading and writing from a stream is allowed,
READ_ONLY_MODE if only reading is allowed,
WRITE_ONLY_MODE if only writing is allowed,
or null if explicitly declared set
Since:
1.2

setMode

public void setMode(String mode)
Sets the allowed mode(s) of operation for this stream configuration. If not set, or explicitly set to null, the stream configuration defaults to read/write. Some configuration validations are relaxed if set to read or write only.

Parameters:
mode - READ_WRITE_MODE if reading and writing from a stream is allowed,
READ_ONLY_MODE if only reading is allowed,
WRITE_ONLY_MODE if only writing is allowed
Since:
1.2

isOrdered

public boolean isOrdered()
Returns whether stream components (records and groups) are ordered.

Returns:
true if stream components are ordered

setOrdered

public void setOrdered(boolean ordered)
Sets whether stream components (records and groups) are ordered. Defaults to true.

Parameters:
ordered - true if stream components are ordered

getResourceBundle

public String getResourceBundle()
Returns the path name of the resource bundle containing customized error messages for this stream.

Returns:
the resource bundle name

setResourceBundle

public void setResourceBundle(String resourceBundle)
Sets the path name of the resource bundle containing customized error messages for this stream.

Parameters:
resourceBundle - the resource bundle name

addHandler

public void addHandler(TypeHandlerConfig handler)
Adds a custom type handler to this stream.

Parameters:
handler - the type handler to add

getHandlerList

public List<TypeHandlerConfig> getHandlerList()
Returns a list of customized type handlers configured for this stream.

Returns:
the list of custom type handlers

getRootGroupConfig

public GroupConfig getRootGroupConfig()
Returns the root group.

Returns:
the root group

addNode

public void addNode(NodeConfig node)
Adds a record or group to this stream's root group.

Parameters:
node - the node to add

setNodeList

public void setNodeList(List<NodeConfig> nodeList)
Sets the list of child nodes for this stream.

Parameters:
nodeList - the list of child nodes

getNodeList

public List<NodeConfig> getNodeList()
Returns the list of child nodes (records and groups) for this stream.

Returns:
the list of child nodes

getReaderFactory

public Bean getReaderFactory()
Returns the record reader factory configuration bean.

Returns:
the record reader factory configuration bean.

setReaderFactory

public void setReaderFactory(Bean readerFactory)
Sets the record reader factory configuration bean.

Parameters:
readerFactory - the record reader factory configuration bean

getWriterFactory

public Bean getWriterFactory()
Returns the record writer factory configuration bean.

Returns:
the record writer factory configuration bean.

setWriterFactory

public void setWriterFactory(Bean writerFactory)
Sets the record writer factory configuration bean.

Parameters:
writerFactory - the record writer factory configuration bean

setMinOccurs

public void setMinOccurs(int minOccurs)
Sets the minimum occurrences of this stream. Defaults to 0.

Parameters:
minOccurs - the minimum occurrences

setMaxOccurs

public void setMaxOccurs(int maxOccurs)
Sets the maximum occurrences of this stream. Defaults to 1

Parameters:
maxOccurs - ths maximum occurrences

BeanIO 1.2.3

Copyright © 2010-2012 Kevin Seim