Class JSONObjectConvertor

  • All Implemented Interfaces:
    JSON.Convertor

    public class JSONObjectConvertor
    extends java.lang.Object
    implements JSON.Convertor
    Converts an Object to JSON using reflection on getters methods.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object fromJSON​(java.util.Map<java.lang.String,​java.lang.Object> map)  
      protected boolean includeField​(java.lang.String name, java.lang.Object o, java.lang.reflect.Method m)  
      void toJSON​(java.lang.Object obj, JSON.Output out)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JSONObjectConvertor

        public JSONObjectConvertor()
      • JSONObjectConvertor

        public JSONObjectConvertor​(boolean fromJSON)
      • JSONObjectConvertor

        public JSONObjectConvertor​(boolean fromJSON,
                                   java.lang.String[] excludedFieldNames)
        Parameters:
        fromJSON - true to convert from JSON
        excludedFieldNames - An array of field names to exclude from the conversion
    • Method Detail

      • fromJSON

        public java.lang.Object fromJSON​(java.util.Map<java.lang.String,​java.lang.Object> map)
        Specified by:
        fromJSON in interface JSON.Convertor
      • includeField

        protected boolean includeField​(java.lang.String name,
                                       java.lang.Object o,
                                       java.lang.reflect.Method m)