public class UnmarshallerImpl extends Object implements Unmarshaller
Unmarshaller
implementation.Constructor and Description |
---|
UnmarshallerImpl(UnmarshallingContext context,
Selector layout,
RecordUnmarshaller recordUnmarshaller)
Constructs a new UnmarshallerImpl
|
Modifier and Type | Method and Description |
---|---|
void |
debug()
Prints the internal view of the stream configuration
to
System.out |
void |
debug(PrintStream out)
Prints the internal view of the stream configuration.
|
RecordContext |
getRecordContext()
Returns record information for the most recent unmarshalled bean object.
|
String |
getRecordName()
Returns the record or group name of the most recent unmarshalled bean object.
|
Object |
unmarshal(List<String> list)
Unmarshals a bean object from the given
List of fields. |
Object |
unmarshal(Node node)
Unmarshals a bean object from the given
Node . |
Object |
unmarshal(String text)
Unmarshals a bean object from the given record text.
|
Object |
unmarshal(String[] array)
Unmarshals a bean object from the given String[] of fields.
|
public UnmarshallerImpl(UnmarshallingContext context, Selector layout, RecordUnmarshaller recordUnmarshaller)
context
- the UnmarshallingContext
layout
- the stream layoutrecordUnmarshaller
- the RecordUnmarshaller
for converting record text to record valuespublic Object unmarshal(String text) throws MalformedRecordException, UnidentifiedRecordException, UnexpectedRecordException, InvalidRecordException
Unmarshaller
unmarshal
in interface Unmarshaller
text
- the record text to unmarhalMalformedRecordException
- if the record text could not be parsed (due to the
expected syntax of the stream format)UnidentifiedRecordException
- if the record type could not be identifiedUnexpectedRecordException
- if the record is out of sequenceInvalidRecordException
- if the record fails validationpublic Object unmarshal(List<String> list) throws BeanReaderException, UnidentifiedRecordException, UnexpectedRecordException, InvalidRecordException
Unmarshaller
List
of fields. This method is supported by
CSV and delimited formatted streams only.unmarshal
in interface Unmarshaller
list
- the List
of fields to unmarshalBeanReaderException
- if a List
is not supported by the stream format,
or if the bean is bound to a record group, or if some other rare (but fatal) error occursUnidentifiedRecordException
- if the record type could not be identifiedUnexpectedRecordException
- if the record is out of sequenceInvalidRecordException
- if the record fails validationpublic Object unmarshal(String[] array) throws BeanReaderException, UnidentifiedRecordException, UnexpectedRecordException, InvalidRecordException
Unmarshaller
unmarshal
in interface Unmarshaller
array
- the String[] of fields to unmarshalBeanReaderException
- if a String[] is not supported by the stream format,
or if the bean is bound to a record group, or if some other rare (but fatal) error occursUnidentifiedRecordException
- if the record type could not be identifiedUnexpectedRecordException
- if the record is out of sequenceInvalidRecordException
- if the record fails validationpublic Object unmarshal(Node node) throws BeanReaderException, UnidentifiedRecordException, UnexpectedRecordException, InvalidRecordException
Unmarshaller
Node
. This method is supported by
XML formatted streams only.unmarshal
in interface Unmarshaller
node
- the Node
to unmarshalBeanReaderException
- if a Node
is not supported by the stream format,
or if the bean is bound to a record group, or if some other rare (but fatal) error occursUnidentifiedRecordException
- if the record type could not be identifiedUnexpectedRecordException
- if the record is out of sequenceInvalidRecordException
- if the record fails validationpublic String getRecordName()
Unmarshaller
getRecordName
in interface Unmarshaller
public RecordContext getRecordContext()
Unmarshaller
getRecordContext
in interface Unmarshaller
RecordContext
public void debug()
Debuggable
System.out
debug
in interface Debuggable
public void debug(PrintStream out)
Debuggable
debug
in interface Debuggable
out
- the PrintStream
to write to