public class StreamConfig extends GroupConfig
By default, a stream can be used for both marshalling (write) and unmarshalling
(read). Calling setMode(String)
can restrict the use of the stream, but
will relax some validations on the types of objects that can be read or written.
Modifier and Type | Field and Description |
---|---|
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
|
JSON_TYPE_ARRAY, JSON_TYPE_BOOLEAN, JSON_TYPE_NONE, JSON_TYPE_NUMBER, JSON_TYPE_OBJECT, JSON_TYPE_STRING
Constructor and Description |
---|
StreamConfig()
Constructs a new StreamConfig.
|
Modifier and Type | Method and Description |
---|---|
void |
addHandler(TypeHandlerConfig handler)
Adds a custom type handler to this stream.
|
char |
getComponentType()
Returns the component type.
|
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.
|
BeanConfig<RecordParserFactory> |
getParserFactory()
Returns the record parser factory configuration bean.
|
String |
getResourceBundle()
Returns the path name of the resource bundle containing customized error
messages for this stream.
|
boolean |
isIgnoreUnidentifiedRecords()
Returns whether to ignore unidentified records.
|
boolean |
isStrict()
Returns whether BeanIO should calculate and enforce strict record ordering
(based on the order records are declared in the mapping file) and record length
(based on configured field occurrences).
|
void |
setFormat(String format)
Sets the format of this stream.
|
void |
setIgnoreUnidentifiedRecords(boolean ignoreUnidentifiedRecords)
Sets whether to ignore unidentified records.
|
void |
setMode(String mode)
Sets the allowed mode(s) of operation for this stream.
|
void |
setParserFactory(BeanConfig<RecordParserFactory> parserFactory)
Sets the record parser factory configuration bean.
|
void |
setResourceBundle(String resourceBundle)
Sets the path name of the resource bundle containing customized error
messages for this stream.
|
void |
setStrict(boolean strict)
Sets whether BeanIO should calculate and enforce strict record ordering
(based on the order records are declared in the mapping file) and record length
(based on configured field occurrences).
|
getKey, getOrder, getTarget, isSupportedChild, setKey, setOrder, setTarget
getCollection, getGetter, getJsonArrayIndex, getJsonName, getJsonType, getLabel, getMaxOccurs, getMaxOccursRef, getMaxSize, getMinOccurs, getMinOccursRef, getMinSize, getOccursRef, getPosition, getSetter, getType, getUntil, getXmlType, isBound, isCollection, isIdentifier, isJsonArray, isLazy, isNillable, isRepeating, setBound, setCollection, setGetter, setIdentifier, setJsonArray, setJsonArrayIndex, setJsonName, setJsonType, setLabel, setLazy, setMaxOccurs, setMaxOccursRef, setMaxSize, setMinOccurs, setMinOccursRef, setMinSize, setNillable, setOccursRef, setPosition, setSetter, setType, setUntil, setXmlType
getOrdinal, getXmlName, getXmlNamespace, getXmlPrefix, isXmlNamespaceAware, setOrdinal, setXmlName, setXmlNamespace, setXmlNamespaceAware, setXmlPrefix
add, clone, find, getChildren, getFirst, getName, isDescendant, iterator, print, print, setName, size, sort, toParamString, toString, updateReferences
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getMaxOccurs, getMinOccurs, getName
forEach, spliterator
public static final String READ_WRITE_MODE
public static final String READ_ONLY_MODE
public static final String WRITE_ONLY_MODE
public char getComponentType()
ComponentConfig
getComponentType
in interface SelectorConfig
getComponentType
in class GroupConfig
ComponentConfig.GROUP
, ComponentConfig.RECORD
, ComponentConfig.SEGMENT
, ComponentConfig.FIELD
,
ComponentConfig.CONSTANT
or ComponentConfig.WRAPPER
public String getFormat()
public void setFormat(String format)
format
- the stream formatpublic String getMode()
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 setpublic void setMode(String mode)
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 allowedpublic String getResourceBundle()
public void setResourceBundle(String resourceBundle)
resourceBundle
- the resource bundle namepublic void addHandler(TypeHandlerConfig handler)
handler
- the type handler to addpublic List<TypeHandlerConfig> getHandlerList()
public BeanConfig<RecordParserFactory> getParserFactory()
public void setParserFactory(BeanConfig<RecordParserFactory> parserFactory)
parserFactory
- the record parser factory configuration beanpublic boolean isStrict()
public void setStrict(boolean strict)
strict
- true if strict, false otherwisepublic boolean isIgnoreUnidentifiedRecords()
public void setIgnoreUnidentifiedRecords(boolean ignoreUnidentifiedRecords)
ignoreUnidentifiedRecords
- true to ignore unidentified records, false otherwise