info.sswap.api.input.io
Class JSONDeserializer

java.lang.Object
  extended by info.sswap.api.input.io.JSONDeserializer
All Implemented Interfaces:
InputDeserializer<org.json.JSONObject>

public class JSONDeserializer
extends java.lang.Object
implements InputDeserializer<org.json.JSONObject>

Creates an Input object from a JSON object serialized by the JSONSerializer.

Author:
Evren Sirin

Constructor Summary
JSONDeserializer()
           
 
Method Summary
protected  java.util.List<Input> createInputs(org.json.JSONObject obj)
           
 PropertyInput createPropertyInput(org.json.JSONObject obj)
           
protected  java.util.List<InputValue> createValues(org.json.JSONObject obj)
           
 Input deserialize(org.json.JSONObject obj)
          Deserializes an Input instance from the given object.
 InputValue deserializeValue(org.json.JSONObject obj)
           
private  void readDescription(org.json.JSONObject obj, Input input)
           
private  void readLabel(org.json.JSONObject obj, Input input)
           
private  void readValue(org.json.JSONObject obj, Input input)
           
protected  void setValueTypes(org.json.JSONObject obj, UnionInput input)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONDeserializer

public JSONDeserializer()
Method Detail

readLabel

private void readLabel(org.json.JSONObject obj,
                       Input input)
                throws org.json.JSONException
Throws:
org.json.JSONException

readDescription

private void readDescription(org.json.JSONObject obj,
                             Input input)
                      throws org.json.JSONException
Throws:
org.json.JSONException

readValue

private void readValue(org.json.JSONObject obj,
                       Input input)
                throws org.json.JSONException
Throws:
org.json.JSONException

deserialize

public Input deserialize(org.json.JSONObject obj)
Description copied from interface: InputDeserializer
Deserializes an Input instance from the given object.

Specified by:
deserialize in interface InputDeserializer<org.json.JSONObject>

deserializeValue

public InputValue deserializeValue(org.json.JSONObject obj)

createInputs

protected java.util.List<Input> createInputs(org.json.JSONObject obj)

createValues

protected java.util.List<InputValue> createValues(org.json.JSONObject obj)

setValueTypes

protected void setValueTypes(org.json.JSONObject obj,
                             UnionInput input)

createPropertyInput

public PropertyInput createPropertyInput(org.json.JSONObject obj)


Copyright (c) 2011, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.