Interface ObjectDeserializer


public interface ObjectDeserializer
  • Method Summary

    Modifier and Type Method Description
    java.lang.Object convert​(java.lang.String value)
    Used for turning attributes and tag names into objects.
    default java.lang.Object convert​(XmlElement element)
    Used in most cases when we have an Element and we need to convert it into an Object.
    default <T> T convert​(XmlElement element, java.lang.Class<T> clazz)  
    static java.util.Map<java.lang.Class<?>,​ObjectDeserializer> defaultDeserializers()  
  • Method Details

    • convert

      java.lang.Object convert​(java.lang.String value)
      Used for turning attributes and tag names into objects. XML that looks like this: <tag attribute="value"></tag> and also: <map> <value>something</value> </map>
      Parameters:
      value - the value to convert
      Returns:
      the object, null is allowed
    • convert

      default java.lang.Object convert​(XmlElement element)
      Used in most cases when we have an Element and we need to convert it into an Object. The default implementation takes the text node and calls the convert(String) method. But if you want to convert something special you will probably want to override this method.
      Parameters:
      element - the XML element to convert
      Returns:
      the object, null is allowed
    • convert

      default <T> T convert​(XmlElement element, java.lang.Class<T> clazz)
    • defaultDeserializers

      static java.util.Map<java.lang.Class<?>,​ObjectDeserializer> defaultDeserializers()