gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.util / org.gvsig.tools.util.api / src / main / java / org / gvsig / json / JsonManager.java @ 2401
History | View | Annotate | Download (2.08 KB)
1 |
package org.gvsig.json; |
---|---|
2 |
|
3 |
import java.util.Map; |
4 |
import javax.json.JsonArray; |
5 |
import javax.json.JsonObject; |
6 |
import javax.json.JsonStructure; |
7 |
import javax.json.JsonValue; |
8 |
import org.gvsig.tools.dynobject.DynObject; |
9 |
import org.gvsig.tools.util.GetItemWithSizeAndIterator; |
10 |
|
11 |
/**
|
12 |
*
|
13 |
* @author gvSIG Team
|
14 |
*/
|
15 |
public interface JsonManager { |
16 |
|
17 |
public static final String ATTRIBUTE_NAME_CLASS = "__classname__"; |
18 |
|
19 |
public interface JsonSerializer { |
20 |
public Class getObjectClass(); |
21 |
public Object toObject(JsonObject json); |
22 |
public JsonObjectBuilder toJsonBuilder(Object value); |
23 |
// public void addAll(Object target, JsonObject source);
|
24 |
// public void addAll(JsonObjectBuilder target, Object source);
|
25 |
} |
26 |
|
27 |
public void registerSerializer(Class<?extends SupportFromJson> theClass); |
28 |
|
29 |
public void registerSerializer(JsonSerializer serializer); |
30 |
|
31 |
public JsonSerializer getSerializer(Object value); |
32 |
|
33 |
public JsonSerializer getSerializer(JsonObject json);
|
34 |
|
35 |
public JsonObjectBuilder createObjectBuilder();
|
36 |
|
37 |
public JsonObjectBuilder createObjectBuilder(String json); |
38 |
|
39 |
public JsonObjectBuilder createObjectBuilder(JsonObject json);
|
40 |
|
41 |
public JsonArrayBuilder createArrayBuilder();
|
42 |
|
43 |
public JsonObject createObject(String json); |
44 |
|
45 |
public JsonArray createArray(String json); |
46 |
|
47 |
public String toString(JsonValue obj); |
48 |
|
49 |
public Object toObject(JsonValue value); |
50 |
|
51 |
public Object toObjectOrDefault(JsonValue value, Object defaultValue); |
52 |
|
53 |
public Object toObject(JsonObject json, String name); |
54 |
|
55 |
public Object toObject(JsonArray json, int index); |
56 |
|
57 |
public Object[] toArray(JsonArray jsonArray, Object[]a); |
58 |
|
59 |
public Iterable<Object> toIterable(final JsonArray jsonArray); |
60 |
|
61 |
public GetItemWithSizeAndIterator<Object> toItems(JsonArray jsonArray); |
62 |
|
63 |
public DynObject addAll(DynObject target, JsonObject json);
|
64 |
|
65 |
public Map toMap(JsonObject json); |
66 |
|
67 |
public JsonPathContext createJSonPathContext(JsonStructure jsonObject);
|
68 |
|
69 |
public JsonPathContext createJSonPathContext(String json); |
70 |
} |