| Index: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/Element.java
|
| diff --git a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/Element.java b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/Element.java
|
| index bfd72fcf75f06e8a579480b17f91c8d7cf4b661e..5a2d19f6690cab6bffc96edc4ad5d926a7a4c1cc 100644
|
| --- a/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/Element.java
|
| +++ b/editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/generated/types/Element.java
|
| @@ -20,6 +20,9 @@ import java.util.Arrays;
|
| import java.util.List;
|
| import java.util.Map;
|
| import com.google.dart.server.utilities.general.ObjectUtilities;
|
| +import com.google.gson.JsonArray;
|
| +import com.google.gson.JsonObject;
|
| +import com.google.gson.JsonPrimitive;
|
| import org.apache.commons.lang3.StringUtils;
|
|
|
| /**
|
| @@ -72,7 +75,7 @@ public class Element {
|
| * - 0x10 - set if the element is private
|
| * - 0x20 - set if the element is deprecated
|
| */
|
| - private final int flags;
|
| + private final Integer flags;
|
|
|
| /**
|
| * The parameter list for the element. If the element is not a method or function this field will
|
| @@ -90,7 +93,7 @@ public class Element {
|
| /**
|
| * Constructor for {@link Element}.
|
| */
|
| - public Element(String kind, String name, Location location, int flags, String parameters, String returnType) {
|
| + public Element(String kind, String name, Location location, Integer flags, String parameters, String returnType) {
|
| this.kind = kind;
|
| this.name = name;
|
| this.location = location;
|
| @@ -124,7 +127,7 @@ public class Element {
|
| * - 0x10 - set if the element is private
|
| * - 0x20 - set if the element is deprecated
|
| */
|
| - public int getFlags() {
|
| + public Integer getFlags() {
|
| return flags;
|
| }
|
|
|
| @@ -190,6 +193,38 @@ public class Element {
|
| return (flags & TOP_LEVEL_STATIC) != 0;
|
| }
|
|
|
| + public JsonObject toJson() {
|
| + // Create a JsonObject
|
| + JsonObject jsonObject = new JsonObject();
|
| +
|
| + // kind
|
| + jsonObject.addProperty("kind", kind);
|
| +
|
| + // name
|
| + jsonObject.addProperty("name", name);
|
| +
|
| + // location
|
| + if (location != null) {
|
| + jsonObject.add("location", location.toJson());
|
| + }
|
| +
|
| + // flags
|
| + jsonObject.addProperty("flags", flags);
|
| +
|
| + // parameters
|
| + if (parameters != null) {
|
| + jsonObject.addProperty("parameters", parameters);
|
| + }
|
| +
|
| + // returnType
|
| + if (returnType != null) {
|
| + jsonObject.addProperty("returnType", returnType);
|
| + }
|
| +
|
| + // Return the JsonObject
|
| + return jsonObject;
|
| + }
|
| +
|
| @Override
|
| public String toString() {
|
| StringBuilder builder = new StringBuilder();
|
|
|