Package org.beanio

Interface Unmarshaller

  • All Superinterfaces:
    Debuggable
    All Known Implementing Classes:
    UnmarshallerImpl

    public interface Unmarshaller
    extends Debuggable
    Interface for unmarshalling single records.

    An Unmarshaller can be used to unmarshal a bean object bound to a record in a mapping file. Unmarshalling bean objects that span multiple records is not supported and will cause a BeanReaderException.

    An Unmarshaller instance is stateful. If a BeanIO mapping file declares record ordering and expected occurrences, a BeanWriterException may be thrown for records read out of sequence or that have exceeded their maximum occurrences.

    There is some performance benefit for reusing the same Unmarshaller instance, but an Unmarshaller is not thread safe and should not be used to unmarshal multiple records concurrently.

    Since:
    2.0
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      RecordContext getRecordContext()
      Returns record information for the most recent unmarshalled bean object.
      java.lang.String getRecordName()
      Returns the record or group name of the most recent unmarshalled bean object.
      java.lang.Object unmarshal​(java.lang.String record)
      Unmarshals a bean object from the given record text.
      java.lang.Object unmarshal​(java.lang.String[] fields)
      Unmarshals a bean object from the given String[] of fields.
      java.lang.Object unmarshal​(java.util.List<java.lang.String> fields)
      Unmarshals a bean object from the given List of fields.
      java.lang.Object unmarshal​(org.w3c.dom.Node node)
      Unmarshals a bean object from the given Node.