OSDN Git Service

Javadocs. #801
authorNathanSweet <nathan.sweet@gmail.com>
Sun, 6 Oct 2013 11:08:21 +0000 (13:08 +0200)
committerNathanSweet <nathan.sweet@gmail.com>
Sun, 6 Oct 2013 11:08:44 +0000 (13:08 +0200)
gdx/src/com/badlogic/gdx/utils/Json.java

index 452a7db..faaa2a4 100644 (file)
@@ -225,6 +225,7 @@ public class Json {
                return writer;\r
        }\r
 \r
+       /** Writes all fields of the specified object to the current JSON object. */\r
        public void writeFields (Object object) {\r
                Class type = object.getClass();\r
 \r
@@ -295,20 +296,24 @@ public class Json {
                return values;\r
        }\r
 \r
+       /** @see #writeField(Object, String, String, Class) */\r
        public void writeField (Object object, String name) {\r
                writeField(object, name, name, null);\r
        }\r
 \r
-       /** @param elementType May be null if the type is unknown. */\r
+       /** @param elementType May be null if the type is unknown.\r
+        * @see #writeField(Object, String, String, Class) */\r
        public void writeField (Object object, String name, Class elementType) {\r
                writeField(object, name, name, elementType);\r
        }\r
 \r
+       /** @see #writeField(Object, String, String, Class) */\r
        public void writeField (Object object, String fieldName, String jsonName) {\r
                writeField(object, fieldName, jsonName, null);\r
        }\r
 \r
-       /** @param elementType May be null if the type is unknown. */\r
+       /** Writes the specified field to the current JSON object.\r
+        * @param elementType May be null if the type is unknown. */\r
        public void writeField (Object object, String fieldName, String jsonName, Class elementType) {\r
                Class type = object.getClass();\r
                ObjectMap<String, FieldMetadata> fields = typeToFields.get(type);\r
@@ -333,7 +338,9 @@ public class Json {
                }\r
        }\r
 \r
-       /** @param value May be null. */\r
+       /** Writes the value as a field on the current JSON object, without writing the actual class.\r
+        * @param value May be null.\r
+        * @see #writeValue(String, Object, Class, Class) */\r
        public void writeValue (String name, Object value) {\r
                try {\r
                        writer.name(name);\r
@@ -346,8 +353,11 @@ public class Json {
                        writeValue(value, value.getClass(), null);\r
        }\r
 \r
-       /** @param value May be null.\r
-        * @param knownType May be null if the type is unknown. */\r
+       /** Writes the value as a field on the current JSON object, writing the class of the object if it differs from the specified\r
+        * known type.\r
+        * @param value May be null.\r
+        * @param knownType May be null if the type is unknown.\r
+        * @see #writeValue(String, Object, Class, Class) */\r
        public void writeValue (String name, Object value, Class knownType) {\r
                try {\r
                        writer.name(name);\r
@@ -357,7 +367,9 @@ public class Json {
                writeValue(value, knownType, null);\r
        }\r
 \r
-       /** @param value May be null.\r
+       /** Writes the value as a field on the current JSON object, writing the class of the object if it differs from the specified\r
+        * known type. The specified element type is used as the default type for collections.\r
+        * @param value May be null.\r
         * @param knownType May be null if the type is unknown.\r
         * @param elementType May be null if the type is unknown. */\r
        public void writeValue (String name, Object value, Class knownType, Class elementType) {\r
@@ -369,7 +381,8 @@ public class Json {
                writeValue(value, knownType, elementType);\r
        }\r
 \r
-       /** @param value May be null. */\r
+       /** Writes the value, without writing the class of the object.\r
+        * @param value May be null. */\r
        public void writeValue (Object value) {\r
                if (value == null)\r
                        writeValue(value, null, null);\r
@@ -377,13 +390,16 @@ public class Json {
                        writeValue(value, value.getClass(), null);\r
        }\r
 \r
-       /** @param value May be null.\r
+       /** Writes the value, writing the class of the object if it differs from the specified known type.\r
+        * @param value May be null.\r
         * @param knownType May be null if the type is unknown. */\r
        public void writeValue (Object value, Class knownType) {\r
                writeValue(value, knownType, null);\r
        }\r
 \r
-       /** @param value May be null.\r
+       /** Writes the value, writing the class of the object if it differs from the specified known type. The specified element type is\r
+        * used as the default type for collections.\r
+        * @param value May be null.\r
         * @param knownType May be null if the type is unknown.\r
         * @param elementType May be null if the type is unknown. */\r
        public void writeValue (Object value, Class knownType, Class elementType) {\r
@@ -550,7 +566,8 @@ public class Json {
                }\r
        }\r
 \r
-       /** @param knownType May be null if the type is unknown. */\r
+       /** Starts writing an object, writing the actualType to a field if needed.\r
+        * @param knownType May be null if the type is unknown. */\r
        public void writeObjectStart (Class actualType, Class knownType) {\r
                try {\r
                        writer.object();\r