diff options
author | 2017-05-23 14:06:51 +0300 | |
---|---|---|
committer | 2017-05-23 15:50:31 +0300 | |
commit | 4c6f3ba0d539f63a83c18e20ed4219bdef849b81 (patch) | |
tree | 184ad8afcaa21ec4eeb7b06bb4f751548e710028 /src/test/java/com/juick/json/JSONSerializer.java | |
parent | 237739950a305b13c9f29e3ca25c2e835d563a3f (diff) |
drop ugnich json
Diffstat (limited to 'src/test/java/com/juick/json/JSONSerializer.java')
-rw-r--r-- | src/test/java/com/juick/json/JSONSerializer.java | 73 |
1 files changed, 0 insertions, 73 deletions
diff --git a/src/test/java/com/juick/json/JSONSerializer.java b/src/test/java/com/juick/json/JSONSerializer.java deleted file mode 100644 index 3dc9e04e..00000000 --- a/src/test/java/com/juick/json/JSONSerializer.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.juick.json; - -import java.text.ParseException; -import java.util.Iterator; -import java.util.List; -import org.json.JSONObject; - -/** - * - * @author vt - * @param <T> - */ -public abstract class JSONSerializer<T> { - - public enum URIScheme { - Plain, - Secure - } - - private URIScheme uriScheme; - - public URIScheme getUriScheme() { - return uriScheme; - } - - public void setUriScheme(URIScheme uriScheme) { - this.uriScheme = uriScheme; - } - - public JSONSerializer() { - this.uriScheme = URIScheme.Plain; - } - - /** - * - * @param json - * @return - */ - public abstract T deserialize(JSONObject json) throws ParseException; - - /** - * - * @param obj - * @return - */ - public abstract JSONObject serialize(T obj); - - /** - * - * @param objs - * @return - */ - public String serializeList(List<T> objs) { - String json = "["; - - Iterator<T> i = objs.iterator(); - while (i.hasNext()) { - T m = i.next(); - if (json.length() > 1) { - json += ","; - } - json += serialize(m).toString(); - } - - json += "]"; - return json; - } -} |