public JSONObject getJson ( ) throws JSONException { JSONObject json = create ( ) ; if ( value != null ) json . put ( "value" , value ) ; if ( label != null ) json . put ( "label" , label ) ; if ( type != null ) json . put ( "type" , type ) ; if ( display != null ) json . put ( "display" , display . toString ( ) ) ; if ( sequence != 0 ) json . put ( "sequence" , sequence ) ; if ( indexKey != null ) json . put ( "indexKey" , indexKey ) ; return json ; }
expects to be a json object named name so does not include name