19 | */
20 | public interface PropertyFilter {
21 | /**
22 | * @param source the owner of the property
23 | * @param name the name of the property
24 | * @param value the value of the property
25 | * @return true if the property will be filtered out, false otherwise
26 | */
27 | boolean apply(Object source, String name, Object value);
28 | }
--------------------------------------------------------------------------------
/jsonsmart-to-easyjson/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 | io.github.bes2008.solution.easyjson
8 | easyjson
9 | 4.1.6
10 |
11 | 4.0.0
12 |
13 | jsonsmart-to-easyjson
14 | ${project.groupId}:${project.artifactId}:${project.version}
15 |
16 | Adapter net.minidev:json-smart:jar to easyjson
17 |
18 |
19 |
20 |
21 | io.github.bes2008.solution.easyjson
22 | easyjson-core
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/jsonsmart-to-easyjson/src/main/java/net/minidev/json/JSONAware.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at http://www.gnu.org/licenses/lgpl-3.0.html
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package net.minidev.json;
16 |
17 | /**
18 | * Beans that support customized output of JSON text shall implement this
19 | * interface.
20 | *
21 | * @author FangYidong <fangyidong@yahoo.com.cn>
22 | */
23 | public interface JSONAware {
24 | /**
25 | * @return JSON text
26 | */
27 | String toJSONString();
28 | }
29 |
--------------------------------------------------------------------------------
/jsonsmart-to-easyjson/src/main/java/net/minidev/json/JSONAwareEx.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at http://www.gnu.org/licenses/lgpl-3.0.html
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package net.minidev.json;
16 |
17 | /**
18 | * Beans that support advanced output of JSON text shall implement this interface.
19 | *
20 | * Adding compressions and formating features
21 | *
22 | * @author Uriel Chemouni <uchemouni@gmail.com>
23 | */
24 |
25 | public interface JSONAwareEx extends JSONAware {
26 | /**
27 | * @return JSON text
28 | */
29 | String toJSONString(JSONStyle compression);
30 | }
31 |
--------------------------------------------------------------------------------
/jsonsmart-to-easyjson/src/main/java/net/minidev/json/JSONStreamAware.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at http://www.gnu.org/licenses/lgpl-3.0.html
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package net.minidev.json;
16 |
17 | import java.io.IOException;
18 |
19 | /**
20 | * Beans that support customized output of JSON text to a writer shall implement
21 | * this interface.
22 | *
23 | * @author FangYidong <fangyidong@yahoo.com.cn>
24 | */
25 | public interface JSONStreamAware {
26 | /**
27 | * write JSON string to out.
28 | */
29 | void writeJSONString(Appendable out) throws IOException;
30 | }
31 |
--------------------------------------------------------------------------------
/jsonsmart-to-easyjson/src/main/java/net/minidev/json/JSONStreamAwareEx.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at http://www.gnu.org/licenses/lgpl-3.0.html
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package net.minidev.json;
16 |
17 | import java.io.IOException;
18 |
19 | /**
20 | * Beans that support customized output of JSON text to a writer shall implement
21 | * this interface.
22 | *
23 | * @author FangYidong <fangyidong@yahoo.com.cn>
24 | */
25 | public interface JSONStreamAwareEx extends JSONStreamAware {
26 | /**
27 | * write JSON string to out.
28 | */
29 | void writeJSONString(Appendable out, JSONStyle compression) throws IOException;
30 | }
31 |
--------------------------------------------------------------------------------
/jsonsmart-to-easyjson/src/main/java/net/minidev/json/annotate/JsonSmartAnnotation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at http://www.gnu.org/licenses/lgpl-3.0.html
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package net.minidev.json.annotate;
16 |
17 | import java.lang.annotation.ElementType;
18 | import java.lang.annotation.Retention;
19 | import java.lang.annotation.RetentionPolicy;
20 | import java.lang.annotation.Target;
21 |
22 | /**
23 | * Jackson Annotation like
24 | *
25 | * @author uriel
26 | */
27 |
28 | @Target({ElementType.ANNOTATION_TYPE})
29 | @Retention(RetentionPolicy.RUNTIME)
30 | public @interface JsonSmartAnnotation {
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/jsonsmart-to-easyjson/src/main/java/net/minidev/json/reader/JsonWriterI.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 the original author or authors.
3 | *
4 | * Licensed under the Apache, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at http://www.gnu.org/licenses/lgpl-3.0.html
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package net.minidev.json.reader;
16 |
17 | import net.minidev.json.JSONStyle;
18 |
19 | import java.io.IOException;
20 |
21 | public interface JsonWriterI {
22 | public void writeJSONString(E value, Appendable out, JSONStyle compression) throws IOException;
23 | }
24 |
--------------------------------------------------------------------------------
/minimaljson-to-easyjson/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | io.github.bes2008.solution.easyjson
7 | easyjson
8 | 4.1.6
9 |
10 | 4.0.0
11 |
12 | minimaljson-to-easyjson
13 | ${project.groupId}:${project.artifactId}:${project.version}
14 |
15 | Adapter Eclipse JSON library com.eclipsesource.minimal-json:minimal-json:jar to easyjson
16 |
17 |
18 |
19 |
20 | io.github.bes2008.solution.easyjson
21 | easyjson-core
22 |
23 |
24 |
--------------------------------------------------------------------------------
/moshi-to-easyjson/src/main/java/com/squareup/moshi/FromJson.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Square, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.squareup.moshi;
17 |
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 |
23 | @Retention(RetentionPolicy.RUNTIME)
24 | @Target(ElementType.METHOD)
25 | public @interface FromJson {
26 | }
27 |
--------------------------------------------------------------------------------
/moshi-to-easyjson/src/main/java/com/squareup/moshi/JsonEncodingException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Square, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.squareup.moshi;
17 |
18 | import com.jn.langx.annotation.Nullable;
19 |
20 | import java.io.IOException;
21 |
22 | /**
23 | * Thrown when the data being parsed is not encoded as valid JSON.
24 | */
25 | public final class JsonEncodingException extends IOException {
26 | public JsonEncodingException(@Nullable String message) {
27 | super(message);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/moshi-to-easyjson/src/main/java/com/squareup/moshi/JsonQualifier.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Square, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.squareup.moshi;
17 |
18 | import java.lang.annotation.Documented;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.Target;
21 |
22 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
23 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
24 |
25 | /**
26 | * Annotates another annotation, causing it to specialize how values are encoded and decoded.
27 | */
28 | @Target(ANNOTATION_TYPE)
29 | @Retention(RUNTIME)
30 | @Documented
31 | public @interface JsonQualifier {
32 | }
33 |
--------------------------------------------------------------------------------
/moshi-to-easyjson/src/main/java/com/squareup/moshi/ToJson.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Square, Inc.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.squareup.moshi;
17 |
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 |
23 | @Retention(RetentionPolicy.RUNTIME)
24 | @Target(ElementType.METHOD)
25 | public @interface ToJson {
26 | }
27 |
--------------------------------------------------------------------------------
/moshi-to-easyjson/src/main/java/com/squareup/moshi/package-info.java:
--------------------------------------------------------------------------------
1 | /** Moshi is modern JSON library for Android and Java. */
2 | package com.squareup.moshi;
3 |
--------------------------------------------------------------------------------
/orgjson-to-easyjson/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | io.github.bes2008.solution.easyjson
7 | easyjson
8 | 4.1.6
9 |
10 | 4.0.0
11 |
12 | orgjson-to-easyjson
13 | ${project.groupId}:${project.artifactId}:${project.version}
14 |
15 | Adapter org.json:json:jar to easyjson
16 |
17 |
18 |
19 |
20 | io.github.bes2008.solution.easyjson
21 | easyjson-core
22 |
23 |
24 | io.github.bes2008.solution.easyjson
25 | easyjson-examples
26 | true
27 | test
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/orgjson-to-easyjson/src/main/java/org/json/JSONException.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /**
4 | * The JSONException is thrown by the JSON.org classes when things are amiss.
5 | *
6 | * @author JSON.org
7 | * @version 2015-12-09
8 | */
9 | public class JSONException extends RuntimeException {
10 | /**
11 | * Serialization ID
12 | */
13 | private static final long serialVersionUID = 0;
14 |
15 | /**
16 | * Constructs a JSONException with an explanatory message.
17 | *
18 | * @param message Detail about the reason for the exception.
19 | */
20 | public JSONException(final String message) {
21 | super(message);
22 | }
23 |
24 | /**
25 | * Constructs a JSONException with an explanatory message and cause.
26 | *
27 | * @param message Detail about the reason for the exception.
28 | * @param cause The cause.
29 | */
30 | public JSONException(final String message, final Throwable cause) {
31 | super(message, cause);
32 | }
33 |
34 | /**
35 | * Constructs a new JSONException with the specified cause.
36 | *
37 | * @param cause The cause.
38 | */
39 | public JSONException(final Throwable cause) {
40 | super(cause.getMessage(), cause);
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/orgjson-to-easyjson/src/main/java/org/json/JSONString.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | /**
4 | * The JSONString
interface allows a toJSONString()
5 | * method so that a class can change the behavior of
6 | * JSONObject.toString()
, JSONArray.toString()
,
7 | * and JSONWriter.value(
Object)
. The
8 | * toJSONString
method will be used instead of the default behavior
9 | * of using the Object's toString()
method and quoting the result.
10 | */
11 | public interface JSONString {
12 | /**
13 | * The toJSONString
method allows a class to produce its own JSON
14 | * serialization.
15 | *
16 | * @return A strictly syntactically correct JSON text.
17 | */
18 | public String toJSONString();
19 | }
20 |
--------------------------------------------------------------------------------
/orgjson-to-easyjson/src/main/java/org/json/JsonTokeners.java:
--------------------------------------------------------------------------------
1 | package org.json;
2 |
3 | public class JsonTokeners {
4 | public static String readToString(JSONTokener jsonTokener) {
5 | if (jsonTokener == null) {
6 | return null;
7 | }
8 | StringBuilder stringBuilder = new StringBuilder(255);
9 | while (!jsonTokener.end() && jsonTokener.more()) {
10 | stringBuilder.append(jsonTokener.next());
11 | }
12 | return stringBuilder.toString();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/JSON/ElementLists/ElementArrayReference.java:
--------------------------------------------------------------------------------
1 | package JSON.ElementLists;
2 |
3 | import JSON.structures.Element;
4 |
5 | public class ElementArrayReference {
6 | public Element[] array;
7 | }
8 |
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/JSON/StringElementMaps/StringElementMap.java:
--------------------------------------------------------------------------------
1 | package JSON.StringElementMaps;
2 |
3 | import JSON.ElementLists.ElementArrayReference;
4 | import references.references.StringArrayReference;
5 |
6 | public class StringElementMap {
7 | public StringArrayReference stringListRef;
8 | public ElementArrayReference elementListRef;
9 | }
10 |
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/JSON/structures/Element.java:
--------------------------------------------------------------------------------
1 | package JSON.structures;
2 |
3 | import JSON.StringElementMaps.StringElementMap;
4 |
5 | public class Element {
6 | public ElementType type;
7 |
8 | public StringElementMap object;
9 | public Element[] array;
10 | public char[] string;
11 | public double number;
12 | public boolean booleanValue;
13 | }
14 |
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/JSON/structures/ElementReference.java:
--------------------------------------------------------------------------------
1 | package JSON.structures;
2 |
3 | public class ElementReference {
4 | public Element element;
5 | }
6 |
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/JSON/structures/ElementType.java:
--------------------------------------------------------------------------------
1 | package JSON.structures;
2 |
3 | public class ElementType {
4 | public char[] name;
5 |
6 | /*
7 | object,
8 | array,
9 | string,
10 | number,
11 | booleanValue,
12 | nullValue,
13 | */
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/com/progsbase/libraries/JSON/GenericTypeGetter.java:
--------------------------------------------------------------------------------
1 | package com.progsbase.libraries.JSON;
2 |
3 | import java.lang.reflect.ParameterizedType;
4 | import java.lang.reflect.Type;
5 |
6 | public class GenericTypeGetter {
7 | public Type getType() {
8 | ParameterizedType genericSuperclass = (ParameterizedType) getClass().getGenericSuperclass();
9 | return genericSuperclass.getActualTypeArguments()[0];
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/com/progsbase/libraries/JSON/JSONException.java:
--------------------------------------------------------------------------------
1 | package com.progsbase.libraries.JSON;
2 |
3 | public class JSONException extends Exception {
4 | public JSONException(String errorMessage) {
5 | super(errorMessage);
6 | }
7 |
8 | public JSONException(Exception e) {
9 | super(e);
10 | }
11 |
12 | public JSONException(Throwable e) {
13 | super(e);
14 | }
15 | }
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/com/progsbase/libraries/JSON/JSONReturn.java:
--------------------------------------------------------------------------------
1 | package com.progsbase.libraries.JSON;
2 |
3 | public class JSONReturn {
4 | public Object object;
5 | public boolean success;
6 | public String errorMessage;
7 | }
8 |
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/com/progsbase/libraries/JSON/Reference.java:
--------------------------------------------------------------------------------
1 | package com.progsbase.libraries.JSON;
2 |
3 | public class Reference {
4 | public T t;
5 | }
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/com/progsbase/libraries/JSON/StringReference.java:
--------------------------------------------------------------------------------
1 | package com.progsbase.libraries.JSON;
2 |
3 | public class StringReference {
4 | public String string;
5 | }
6 |
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/com/progsbase/libraries/JSON/StringReturn.java:
--------------------------------------------------------------------------------
1 | package com.progsbase.libraries.JSON;
2 |
3 | public class StringReturn {
4 | public String str;
5 | public boolean success;
6 | public String errorMessage;
7 | }
8 |
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/references/references/BooleanArrayReference.java:
--------------------------------------------------------------------------------
1 | package references.references;
2 |
3 | public class BooleanArrayReference {
4 | public boolean[] booleanArray;
5 | }
6 |
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/references/references/BooleanReference.java:
--------------------------------------------------------------------------------
1 | package references.references;
2 |
3 | public class BooleanReference {
4 | public boolean booleanValue;
5 | }
6 |
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/references/references/CharacterReference.java:
--------------------------------------------------------------------------------
1 | package references.references;
2 |
3 | public class CharacterReference {
4 | public char characterValue;
5 | }
6 |
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/references/references/NumberArrayReference.java:
--------------------------------------------------------------------------------
1 | package references.references;
2 |
3 | public class NumberArrayReference {
4 | public double[] numberArray;
5 | }
6 |
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/references/references/NumberReference.java:
--------------------------------------------------------------------------------
1 | package references.references;
2 |
3 | public class NumberReference {
4 | public double numberValue;
5 | }
6 |
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/references/references/StringArrayReference.java:
--------------------------------------------------------------------------------
1 | package references.references;
2 |
3 | public class StringArrayReference {
4 | public StringReference[] stringArray;
5 | }
--------------------------------------------------------------------------------
/progsbase-to-easyjson/src/main/java/references/references/StringReference.java:
--------------------------------------------------------------------------------
1 | package references.references;
2 |
3 | public class StringReference {
4 | public char[] string;
5 | }
6 |
--------------------------------------------------------------------------------
/simplejson-to-easyjson/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | io.github.bes2008.solution.easyjson
7 | easyjson
8 | 4.1.6
9 |
10 | 4.0.0
11 |
12 | simplejson-to-easyjson
13 | ${project.groupId}:${project.artifactId}:${project.version}
14 |
15 | Adapter com.googlecode.json-simple:json-simple:jar to easyjson
16 |
17 |
18 |
19 |
20 | io.github.bes2008.solution.easyjson
21 | easyjson-core
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/simplejson-to-easyjson/src/main/java/org/json/simple/JSONAware.java:
--------------------------------------------------------------------------------
1 | package org.json.simple;
2 |
3 | /**
4 | * Beans that support customized output of JSON text shall implement this interface.
5 | *
6 | * @author FangYidong
7 | */
8 | public interface JSONAware {
9 | /**
10 | * @return JSON text
11 | */
12 | String toJSONString();
13 | }
14 |
--------------------------------------------------------------------------------
/simplejson-to-easyjson/src/main/java/org/json/simple/JSONStreamAware.java:
--------------------------------------------------------------------------------
1 | package org.json.simple;
2 |
3 | import java.io.IOException;
4 | import java.io.Writer;
5 |
6 | /**
7 | * Beans that support customized output of JSON text to a writer shall implement this interface.
8 | *
9 | * @author FangYidong
10 | */
11 | public interface JSONStreamAware {
12 | /**
13 | * write JSON string to out.
14 | */
15 | void writeJSONString(Writer out) throws IOException;
16 | }
17 |
--------------------------------------------------------------------------------
/simplejson-to-easyjson/src/main/java/org/json/simple/parser/ContainerFactory.java:
--------------------------------------------------------------------------------
1 | package org.json.simple.parser;
2 |
3 | import java.util.List;
4 | import java.util.Map;
5 |
6 | /**
7 | * Container factory for creating containers for JSON object and JSON array.
8 | *
9 | * @author FangYidong
10 | * @see org.json.simple.parser.JSONParser#parse(java.io.Reader, ContainerFactory)
11 | */
12 | public interface ContainerFactory {
13 | /**
14 | * @return A Map instance to store JSON object, or null if you want to use org.json.simple.JSONObject.
15 | */
16 | Map createObjectContainer();
17 |
18 | /**
19 | * @return A List instance to store JSON array, or null if you want to use org.json.simple.JSONArray.
20 | */
21 | List creatArrayContainer();
22 | }
23 |
--------------------------------------------------------------------------------