public class Stream extends Object
Modifier and Type | Field and Description |
---|---|
static int |
READ_ONLY_MODE
Stream definition supports reading only
|
static int |
READ_WRITE_MODE
Stream definition supports reading and writing
|
static int |
WRITE_ONLY_MODE
Stream definition supports writing only
|
Constructor and Description |
---|
Stream(StreamFormat format)
Constructs a new Stream.
|
Modifier and Type | Method and Description |
---|---|
BeanReader |
createBeanReader(Reader in,
Locale locale)
Creates a new
BeanReader for reading from the given input stream. |
BeanWriter |
createBeanWriter(Writer out)
Creates a new
BeanWriter for writing to the given output stream. |
Marshaller |
createMarshaller()
Creates a new
Marshaller . |
Unmarshaller |
createUnmarshaller(Locale locale)
Creates a new
Unmarshaller . |
StreamFormat |
getFormat() |
Selector |
getLayout() |
MessageFactory |
getMessageFactory() |
int |
getMode()
Returns the allowed mode of operation for this stream configuration.
|
String |
getName()
Returns the name of this stream.
|
void |
init() |
boolean |
isIgnoreUnidentifiedRecords()
Returns whether to ignore unidentified records.
|
void |
setFormat(StreamFormat format) |
void |
setIgnoreUnidentifiedRecords(boolean ignoreUnidentifiedRecords)
Sets whether to ignore unidentified records.
|
void |
setLayout(Selector layout) |
void |
setMessageFactory(MessageFactory messageFactory) |
void |
setMode(int mode)
Sets the allowed mode of operation for this stream configuration.
|
public static final int READ_WRITE_MODE
public static final int READ_ONLY_MODE
public static final int WRITE_ONLY_MODE
public Stream(StreamFormat format)
format
- the StreamFormat
public void init()
public String getName()
public BeanReader createBeanReader(Reader in, Locale locale)
BeanReader
for reading from the given input stream.in
- the input stream to read fromlocale
- the locale to use for rendering error messagesBeanReader
public Unmarshaller createUnmarshaller(Locale locale)
Unmarshaller
.locale
- the Locale
to use for rendering error messagesUnmarshaller
public BeanWriter createBeanWriter(Writer out)
BeanWriter
for writing to the given output stream.out
- the output stream to write toBeanWriter
public Marshaller createMarshaller()
Marshaller
.Marshaller
public int 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 allowedpublic void setMode(int 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 Selector getLayout()
public void setLayout(Selector layout)
public StreamFormat getFormat()
public void setFormat(StreamFormat format)
public MessageFactory getMessageFactory()
public void setMessageFactory(MessageFactory messageFactory)
public boolean isIgnoreUnidentifiedRecords()
public void setIgnoreUnidentifiedRecords(boolean ignoreUnidentifiedRecords)
ignoreUnidentifiedRecords
- true to ignore unidentified records, false otherwise