/*
 * Copyright 2015 brutusin.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.brutusin.json.spi;

import org.brutusin.json.ParseException;

/**
 * @author Ignacio del Valle Alles idelvall@brutusin.org
 */
public interface JsonDataCodec {

    public String quoteAsUTF8(String s);

    public <T> T parse(String json, Class<T> clazz) throws ParseException;

    public JsonNode parse(String json) throws ParseException;

    public <T> T load(JsonNode node, Class<T> clazz);

    public String transform(Object o);

    public JsonNode toJsonNode(Object o);

    public String prettyPrint(String json) throws ParseException;
}

@@ -1,10 +1,11 @@
 /*
+%0D
 %0A * Copy
@@ -27,19 +27,21 @@
 usin.org
+%0D
 %0A *
+%0D
 %0A * Lice
@@ -99,16 +99,17 @@
 cense%22);
+%0D
 %0A * you 
@@ -168,16 +168,17 @@
 License.
+%0D
 %0A * You 
@@ -212,19 +212,21 @@
 cense at
+%0D
 %0A *
+%0D
 %0A * http
@@ -263,19 +263,21 @@
 ENSE-2.0
+%0D
 %0A *
+%0D
 %0A * Unle
@@ -339,16 +339,17 @@
 software
+%0D
 %0A * dist
@@ -409,16 +409,17 @@
 %22 BASIS,
+%0D
 %0A * WITH
@@ -486,16 +486,17 @@
 implied.
+%0D
 %0A * See 
@@ -558,16 +558,17 @@
 ions and
+%0D
 %0A * limi
@@ -593,20 +593,22 @@
 License.
+%0D
 %0A */
+%0D
 %0Apackage
@@ -630,17 +630,51 @@
 son.spi;
-%0A
+%0D%0A%0D%0Aimport java.lang.reflect.Type;%0D
 %0Aimport 
@@ -710,13 +710,16 @@
 ion;
-%0A
+%0D%0A%0D
 %0A/**
+%0D
 %0A * 
@@ -771,20 +771,22 @@
 usin.org
+%0D
 %0A */
+%0D
 %0Apublic 
@@ -810,17 +810,19 @@
 aCodec %7B
-%0A
+%0D%0A%0D
 %0A    pub
@@ -854,17 +854,19 @@
 ring s);
-%0A
+%0D%0A%0D
 %0A    pub
@@ -924,33 +924,112 @@
  ParseException;
-%0A
+%0D%0A   %0D%0A    public Object parse(String json, Type type) throws ParseException;%0D%0A%0D
 %0A    public Json
@@ -1074,17 +1074,19 @@
 ception;
-%0A
+%0D%0A%0D
 %0A    pub
@@ -1131,17 +1131,76 @@
  clazz);
-%0A
+%0D%0A    %0D%0A    public Object load(JsonNode node, Type type);%0D%0A%0D
 %0A    pub
@@ -1222,33 +1222,35 @@
 sform(Object o);
-%0A
+%0D%0A%0D
 %0A    public Json
@@ -1275,17 +1275,19 @@
 ject o);
-%0A
+%0D%0A%0D
 %0A    pub
@@ -1348,7 +1348,9 @@
 ion;
+%0D
 %0A%7D
+%0D
 %0A

add type-based methods