Interface Unmarshaller

All Known Implementing Classes:
IntrospectingUnmarshaller

public interface Unmarshaller
An unmarshaller takes events as they occur when unmarshalling hierarchically organised structures in stream form (like e.g. XML) and converts them to Java objects. How exactly this is done and how the resulting Java object is received, depends on the implementation.
  • Method Details

    • setLocation

      void setLocation(Location location)
      Set the current location. This is used for error messages. Implementations should always make a copy of this location to allow event emitters, to put a "live" version here, i.e. one that changes during parsing always reflecting the current location.
      Parameters:
      location - The location.
    • startElement

      void startElement(String element, Map<String,String> attributes) throws UnmarshalException
      Start a new element.
      Parameters:
      element - The element's name.
      attributes - A map of attributes as read from the tag.
      Throws:
      UnmarshalException - If an error occurs.
    • endElement

      void endElement() throws UnmarshalException
      End an element.
      Throws:
      UnmarshalException - If an error occurs.
    • content

      void content(String content) throws UnmarshalException
      Set an element's text content. This may be called only once per element. Content and sub hierarchies may not be combined.
      Parameters:
      content - The text content.
      Throws:
      UnmarshalException - If an error occurs.
    • reset

      void reset()
      Reset the unmarshaller. This should be called on the start of each document.
    • conclude

      void conclude() throws UnmarshalException
      Conclude one resource. This should be called at the end of each document.
      Throws:
      UnmarshalException - If an error occurs.