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 UnmarshallingContextlayout - the stream layoutrecordUnmarshaller - the RecordUnmarshaller for converting record text to record valuespublic Object unmarshal(String text) throws MalformedRecordException, UnidentifiedRecordException, UnexpectedRecordException, InvalidRecordException
Unmarshallerunmarshal in interface Unmarshallertext - 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
UnmarshallerList of fields. This method is supported by
CSV and delimited formatted streams only.unmarshal in interface Unmarshallerlist - 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
Unmarshallerunmarshal in interface Unmarshallerarray - 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
UnmarshallerNode. This method is supported by
XML formatted streams only.unmarshal in interface Unmarshallernode - 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()
UnmarshallergetRecordName in interface Unmarshallerpublic RecordContext getRecordContext()
UnmarshallergetRecordContext in interface UnmarshallerRecordContextpublic void debug()
DebuggableSystem.outdebug in interface Debuggablepublic void debug(PrintStream out)
Debuggabledebug in interface Debuggableout - the PrintStream to write to