Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 743 Bytes

converters.rst

File metadata and controls

28 lines (21 loc) · 743 Bytes

Custom Converters

:doc:`ORM <orm>`, :doc:`JSON <json>` & :doc:`XML <xml>` support the following types:

  • primitives & wrappers
  • String
  • Enum
  • Date
  • UUID
  • Uri
  • JSONObject
  • JSONArray
  • Bitmap
  • Model & Entity
  • arrays & collections of the above
  • Maps

If you need to support an extra type:

  1. Subclass Converter, implement required methods. See existing converters for an example.
  2. Register it by calling AbstractApplication.registerConverter(Converter<?> converter);.

For custom JSON/XML deserialization, subclass ModelConverter or EntityCoverter and override the following methods:

  • getJSONSerializer(Class<M> valType, JSONObject src)
  • getXMLSerializer(Class<M> valType, Node src)