Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2015-11-27 08:38:42 +0000
committerTom Schindl2015-11-27 08:38:42 +0000
commit8527b0b609a9e2e3eef16a36c8962785378f1722 (patch)
tree804fb9fcf5de34bb859577c0d0a3f6de79499d1b
parentefd87c8bf47c86327c5c944c2076ffc6641f83f4 (diff)
downloadorg.eclipse.efxclipse-8527b0b609a9e2e3eef16a36c8962785378f1722.tar.gz
org.eclipse.efxclipse-8527b0b609a9e2e3eef16a36c8962785378f1722.tar.xz
org.eclipse.efxclipse-8527b0b609a9e2e3eef16a36c8962785378f1722.zip
Bug 483105 - Add an editor for JSON
-rw-r--r--bundles/runtime/org.eclipse.fx.json.schema/.settings/org.eclipse.fx.ide.gmodel.GModelDSL.prefs12
-rw-r--r--bundles/runtime/org.eclipse.fx.json.schema/META-INF/MANIFEST.MF1
-rw-r--r--bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/.gitignore4
-rw-r--r--bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/JsonSchema.java31
-rw-r--r--bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/JsonSchemaBase.java5
-rw-r--r--bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/JsonSchemaGModel.java16
-rw-r--r--bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/JsonSchemaMap.java9
-rw-r--r--bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/.gitignore4
-rw-r--r--bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/GsonBase.java22
-rw-r--r--bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/GsonElementFactory.java75
-rw-r--r--bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/GsonJsonSchemaImpl.java205
-rw-r--r--bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/GsonJsonSchemaMapImpl.java71
-rw-r--r--bundles/runtime/org.eclipse.fx.json.schema/src/org/eclipse/fx/json/schema/JsonSchema.gmod2
13 files changed, 448 insertions, 9 deletions
diff --git a/bundles/runtime/org.eclipse.fx.json.schema/.settings/org.eclipse.fx.ide.gmodel.GModelDSL.prefs b/bundles/runtime/org.eclipse.fx.json.schema/.settings/org.eclipse.fx.ide.gmodel.GModelDSL.prefs
new file mode 100644
index 000000000..37937b72c
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.json.schema/.settings/org.eclipse.fx.ide.gmodel.GModelDSL.prefs
@@ -0,0 +1,12 @@
+BuilderConfiguration.is_project_specific=true
+autobuilding=true
+eclipse.preferences.version=1
+outlet.DEFAULT_OUTPUT.cleanDirectory=false
+outlet.DEFAULT_OUTPUT.cleanupDerived=true
+outlet.DEFAULT_OUTPUT.createDirectory=true
+outlet.DEFAULT_OUTPUT.derived=false
+outlet.DEFAULT_OUTPUT.directory=./src-gen
+outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
+outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
+outlet.DEFAULT_OUTPUT.keepLocalHistory=true
+outlet.DEFAULT_OUTPUT.override=true
diff --git a/bundles/runtime/org.eclipse.fx.json.schema/META-INF/MANIFEST.MF b/bundles/runtime/org.eclipse.fx.json.schema/META-INF/MANIFEST.MF
index 607e7a7b0..9d79aa1bc 100644
--- a/bundles/runtime/org.eclipse.fx.json.schema/META-INF/MANIFEST.MF
+++ b/bundles/runtime/org.eclipse.fx.json.schema/META-INF/MANIFEST.MF
@@ -5,3 +5,4 @@ Bundle-SymbolicName: org.eclipse.fx.json.schema
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: com.google.gson;bundle-version="2.2.4"
+Export-Package: org.eclipse.fx.json.schema
diff --git a/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/.gitignore b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/.gitignore
deleted file mode 100644
index 7881f2f3b..000000000
--- a/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/JsonSchema.java
-/JsonSchemaBase.java
-/JsonSchemaGModel.java
-/JsonSchemaMap.java
diff --git a/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/JsonSchema.java b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/JsonSchema.java
new file mode 100644
index 000000000..714213a12
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/JsonSchema.java
@@ -0,0 +1,31 @@
+package org.eclipse.fx.json.schema;
+
+public interface JsonSchema extends JsonSchemaBase {
+ public String getId();
+ public String getSchema();
+ public String getTitle();
+ public String getDescription();
+ public double getMaximum();
+ public double getMinimum();
+ public JsonSchema getItems();
+ public String getType();
+ public java.util.List<String> getRequired();
+ public JsonSchemaMap getProperties();
+ public JsonSchemaMap getDefinitions();
+
+ public interface Builder {
+ public Builder id(String id);
+ public Builder schema(String schema);
+ public Builder title(String title);
+ public Builder description(String description);
+ public Builder maximum(double maximum);
+ public Builder minimum(double minimum);
+ public Builder items(JsonSchema items);
+ public Builder type(String type);
+ public Builder required(java.util.List<String> required);
+ public Builder appendRequired(String required);
+ public Builder properties(JsonSchemaMap properties);
+ public Builder definitions(JsonSchemaMap definitions);
+ public JsonSchema build();
+ }
+}
diff --git a/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/JsonSchemaBase.java b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/JsonSchemaBase.java
new file mode 100644
index 000000000..cf0d5cffa
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/JsonSchemaBase.java
@@ -0,0 +1,5 @@
+package org.eclipse.fx.json.schema;
+
+public interface JsonSchemaBase {
+
+}
diff --git a/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/JsonSchemaGModel.java b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/JsonSchemaGModel.java
new file mode 100644
index 000000000..f1fd09406
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/JsonSchemaGModel.java
@@ -0,0 +1,16 @@
+package org.eclipse.fx.json.schema;
+
+public interface JsonSchemaGModel {
+ public static JsonSchemaGModel create() {
+ return new org.eclipse.fx.json.schema.gson.GsonElementFactory();
+ }
+
+ public <T extends JsonSchemaBase> T createObject(java.io.Reader json);
+ public <T extends JsonSchemaBase> java.util.List<T> createList(java.io.Reader json);
+
+ public String toString(JsonSchemaBase o);
+ public String toString(java.util.List<JsonSchemaBase> o);
+
+ public JsonSchema.Builder JsonSchemaBuilder();
+ public JsonSchemaMap.Builder JsonSchemaMapBuilder();
+}
diff --git a/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/JsonSchemaMap.java b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/JsonSchemaMap.java
new file mode 100644
index 000000000..8917d200d
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/JsonSchemaMap.java
@@ -0,0 +1,9 @@
+package org.eclipse.fx.json.schema;
+
+public interface JsonSchemaMap extends JsonSchemaBase {
+ public java.util.Map<String,JsonSchema> getPropertyMap();
+
+ public interface Builder {
+ public JsonSchemaMap build();
+ }
+}
diff --git a/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/.gitignore b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/.gitignore
deleted file mode 100644
index 4263f7187..000000000
--- a/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/GsonBase.java
-/GsonElementFactory.java
-/GsonJsonSchemaImpl.java
-/GsonJsonSchemaMapImpl.java
diff --git a/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/GsonBase.java b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/GsonBase.java
new file mode 100644
index 000000000..bb0802a09
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/GsonBase.java
@@ -0,0 +1,22 @@
+package org.eclipse.fx.json.schema.gson;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import java.util.List;
+
+public interface GsonBase {
+ public static JsonArray toJsonArray(List<JsonElement> list) {
+ JsonArray ar = new JsonArray();
+ list.stream().forEach(ar::add);
+ return ar;
+ }
+
+ public static JsonArray toDomainJsonArray(List<?> list) {
+ JsonArray ar = new JsonArray();
+ list.stream().map( e -> (GsonBase)e ).map(GsonBase::toJSONObject).forEach(ar::add);
+ return ar;
+ }
+
+ public JsonObject toJSONObject();
+}
diff --git a/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/GsonElementFactory.java b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/GsonElementFactory.java
new file mode 100644
index 000000000..f9590402d
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/GsonElementFactory.java
@@ -0,0 +1,75 @@
+package org.eclipse.fx.json.schema.gson;
+
+import org.eclipse.fx.json.schema.*;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonArray;
+
+public final class GsonElementFactory implements JsonSchemaGModel {
+ public static JsonSchema createJsonSchema(JsonObject o) {
+ if( o.has("$gtype") ) {
+ switch( o.get("$gtype").getAsString() ) {
+ case "JsonSchema":
+ return new GsonJsonSchemaImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonJsonSchemaImpl(o);
+ }
+ }
+ public JsonSchema.Builder JsonSchemaBuilder() {
+ return new GsonJsonSchemaImpl.Builder(this);
+ }
+
+ public static JsonSchemaMap createJsonSchemaMap(JsonObject o) {
+ if( o.has("$gtype") ) {
+ switch( o.get("$gtype").getAsString() ) {
+ case "JsonSchemaMap":
+ return new GsonJsonSchemaMapImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonJsonSchemaMapImpl(o);
+ }
+ }
+ public JsonSchemaMap.Builder JsonSchemaMapBuilder() {
+ return new GsonJsonSchemaMapImpl.Builder(this);
+ }
+
+
+
+ public <T extends JsonSchemaBase> T createObject(java.io.Reader json) {
+ JsonObject o = new com.google.gson.Gson().fromJson( json, JsonObject.class);
+ return _createObject(o);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static <T extends JsonSchemaBase> T _createObject(JsonObject o) {
+ if( o.has("$gtype") ) {
+ switch( o.get("$gtype").getAsString() ) {
+ case "JsonSchema":
+ return (T) createJsonSchema(o);
+ case "JsonSchemaMap":
+ return (T) createJsonSchemaMap(o);
+ }
+ }
+ return (T) createJsonSchema(o);
+ }
+
+ public <T extends JsonSchemaBase> java.util.List<T> createList(java.io.Reader json) {
+ JsonArray ar = new com.google.gson.Gson().fromJson( json, JsonArray.class);
+ return java.util.stream.StreamSupport.stream(ar.spliterator(), false)
+ .map( e -> (JsonObject)e)
+ .map( GsonElementFactory::<T>_createObject)
+ .collect(java.util.stream.Collectors.toList());
+ }
+
+ public String toString(JsonSchemaBase o) {
+ return new com.google.gson.GsonBuilder().setPrettyPrinting().create().toJson( ((GsonBase)o).toJSONObject() );
+ }
+
+ public String toString(java.util.List<JsonSchemaBase> o) {
+ return new com.google.gson.GsonBuilder().setPrettyPrinting().create().toJson( GsonBase.toDomainJsonArray(o) );
+ }
+}
diff --git a/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/GsonJsonSchemaImpl.java b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/GsonJsonSchemaImpl.java
new file mode 100644
index 000000000..53099e7a9
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/GsonJsonSchemaImpl.java
@@ -0,0 +1,205 @@
+package org.eclipse.fx.json.schema.gson;
+
+import org.eclipse.fx.json.schema.*;
+import com.google.gson.JsonObject;
+
+public final class GsonJsonSchemaImpl implements GsonBase, JsonSchema {
+ public GsonJsonSchemaImpl(JsonObject jsonObject) {
+ this.definitions = jsonObject.has("definitions") ? GsonElementFactory.createJsonSchemaMap(jsonObject.getAsJsonObject("definitions")) : null;
+ this.description = jsonObject.has("description") ? jsonObject.get("description").getAsString() : null;
+ this.id = jsonObject.has("id") ? jsonObject.get("id").getAsString() : null;
+ this.items = jsonObject.has("items") ? GsonElementFactory.createJsonSchema(jsonObject.getAsJsonObject("items")) : null;
+ this.maximum = jsonObject.has("maximum") ? jsonObject.get("maximum").getAsDouble() : 0.0;
+ this.minimum = jsonObject.has("minimum") ? jsonObject.get("minimum").getAsDouble() : 0.0;
+ this.properties = jsonObject.has("properties") ? GsonElementFactory.createJsonSchemaMap(jsonObject.getAsJsonObject("properties")) : null;
+ this.required = jsonObject.has("required") ? java.util.Collections.unmodifiableList(java.util.stream.StreamSupport.stream( jsonObject.getAsJsonArray("required").spliterator(), false )
+ .map( e -> e.getAsString()).collect(java.util.stream.Collectors.toList())) : java.util.Collections.emptyList();
+ this.schema = jsonObject.has("schema") ? jsonObject.get("schema").getAsString() : null;
+ this.title = jsonObject.has("title") ? jsonObject.get("title").getAsString() : null;
+ this.type = jsonObject.has("type") ? jsonObject.get("type").getAsString() : null;
+ }
+ public GsonJsonSchemaImpl(JsonSchemaMap definitions, String description, String id, JsonSchema items, double maximum, double minimum, JsonSchemaMap properties, java.util.List<String> required, String schema, String title, String type) {
+ this.definitions = definitions;
+ this.description = description;
+ this.id = id;
+ this.items = items;
+ this.maximum = maximum;
+ this.minimum = minimum;
+ this.properties = properties;
+ this.required = required;
+ this.schema = schema;
+ this.title = title;
+ this.type = type;
+ }
+
+ public JsonObject toJSONObject() {
+ JsonObject o = new JsonObject();
+ o.addProperty( "$gtype", "JsonSchema" );
+ o.add( "definitions", getDefinitions() == null ? null : ((GsonBase)getDefinitions()).toJSONObject() );
+ o.addProperty( "description", getDescription() );
+ o.addProperty( "id", getId() );
+ o.add( "items", getItems() == null ? null : ((GsonBase)getItems()).toJSONObject() );
+ o.addProperty( "maximum", getMaximum() );
+ o.addProperty( "minimum", getMinimum() );
+ o.add( "properties", getProperties() == null ? null : ((GsonBase)getProperties()).toJSONObject() );
+ o.add( "required", GsonBase.toJsonArray(getRequired().stream().map(com.google.gson.JsonPrimitive::new).collect(java.util.stream.Collectors.toList())) );
+ o.addProperty( "schema", getSchema() );
+ o.addProperty( "title", getTitle() );
+ o.addProperty( "type", getType() );
+ return o;
+ }
+
+ public String toString() {
+ return getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + " { "
+ + "definitions : " + (definitions == null ? null : definitions.getClass().getSimpleName() + "@" + Integer.toHexString(definitions.hashCode())) + ", "
+ + "description : " + description + ", "
+ + "id : " + id + ", "
+ + "items : " + (items == null ? null : items.getClass().getSimpleName() + "@" + Integer.toHexString(items.hashCode())) + ", "
+ + "maximum : " + maximum + ", "
+ + "minimum : " + minimum + ", "
+ + "properties : " + (properties == null ? null : properties.getClass().getSimpleName() + "@" + Integer.toHexString(properties.hashCode())) + ", "
+ + "required : " + required + ", "
+ + "schema : " + schema + ", "
+ + "title : " + title + ", "
+ + "type : " + type
+ +" }";
+ }
+
+ private final JsonSchemaMap definitions;
+ public JsonSchemaMap getDefinitions() {
+ return this.definitions;
+ }
+
+
+ private final String description;
+ public String getDescription() {
+ return this.description;
+ }
+
+
+ private final String id;
+ public String getId() {
+ return this.id;
+ }
+
+
+ private final JsonSchema items;
+ public JsonSchema getItems() {
+ return this.items;
+ }
+
+
+ private final double maximum;
+ public double getMaximum() {
+ return this.maximum;
+ }
+
+
+ private final double minimum;
+ public double getMinimum() {
+ return this.minimum;
+ }
+
+
+ private final JsonSchemaMap properties;
+ public JsonSchemaMap getProperties() {
+ return this.properties;
+ }
+
+
+ private final java.util.List<String> required;
+ public java.util.List<String> getRequired() {
+ return this.required;
+ }
+
+
+ private final String schema;
+ public String getSchema() {
+ return this.schema;
+ }
+
+
+ private final String title;
+ public String getTitle() {
+ return this.title;
+ }
+
+
+ private final String type;
+ public String getType() {
+ return this.type;
+ }
+
+
+
+ public static class Builder implements JsonSchema.Builder {
+ private final JsonSchemaGModel instance;
+
+ public Builder(JsonSchemaGModel instance) {
+ this.instance = instance;
+ }
+ private JsonSchemaMap definitions;
+ public Builder definitions(JsonSchemaMap definitions) {
+ this.definitions = definitions;
+ return this;
+ }
+ private String description;
+ public Builder description(String description) {
+ this.description = description;
+ return this;
+ }
+ private String id;
+ public Builder id(String id) {
+ this.id = id;
+ return this;
+ }
+ private JsonSchema items;
+ public Builder items(JsonSchema items) {
+ this.items = items;
+ return this;
+ }
+ private double maximum;
+ public Builder maximum(double maximum) {
+ this.maximum = maximum;
+ return this;
+ }
+ private double minimum;
+ public Builder minimum(double minimum) {
+ this.minimum = minimum;
+ return this;
+ }
+ private JsonSchemaMap properties;
+ public Builder properties(JsonSchemaMap properties) {
+ this.properties = properties;
+ return this;
+ }
+ private final java.util.List<String> required = new java.util.ArrayList<>();
+ public Builder required(java.util.List<String> required) {
+ this.required.addAll(required);
+ return this;
+ }
+ public Builder appendRequired(String required) {
+ this.required.add(required);
+ return this;
+ }
+ private String schema;
+ public Builder schema(String schema) {
+ this.schema = schema;
+ return this;
+ }
+ private String title;
+ public Builder title(String title) {
+ this.title = title;
+ return this;
+ }
+ private String type;
+ public Builder type(String type) {
+ this.type = type;
+ return this;
+ }
+
+ public JsonSchema build() {
+ return new GsonJsonSchemaImpl(definitions, description, id, items, maximum, minimum, properties, required, schema, title, type);
+ }
+ }
+}
diff --git a/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/GsonJsonSchemaMapImpl.java b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/GsonJsonSchemaMapImpl.java
new file mode 100644
index 000000000..bd1d21319
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.json.schema/src-gen/org/eclipse/fx/json/schema/gson/GsonJsonSchemaMapImpl.java
@@ -0,0 +1,71 @@
+package org.eclipse.fx.json.schema.gson;
+
+import org.eclipse.fx.json.schema.*;
+import com.google.gson.JsonObject;
+
+public final class GsonJsonSchemaMapImpl implements GsonBase, JsonSchemaMap {
+ public GsonJsonSchemaMapImpl(JsonObject jsonObject) {
+ this.propertyMap = toMap(jsonObject);
+ }
+ public GsonJsonSchemaMapImpl(java.util.Map<String,JsonSchema> propertyMap) {
+ this.propertyMap = propertyMap;
+ }
+
+ public JsonObject toJSONObject() {
+ JsonObject o = new JsonObject();
+ o.addProperty( "$gtype", "JsonSchemaMap" );
+ return o;
+ }
+
+ public String toString() {
+ return getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + " { "
+ + "propertyMap : " + propertyMap
+ +" }";
+ }
+
+ private static java.util.Map<String,JsonSchema> toMap(JsonObject o) {
+ java.util.Map<String,JsonSchema> rv = new java.util.HashMap<>();
+ for( java.util.Map.Entry<String,com.google.gson.JsonElement> e : o.entrySet() ) {
+ rv.put( e.getKey(), GsonElementFactory.createJsonSchema(e.getValue().getAsJsonObject()) );
+ }
+ return rv;
+ }
+
+ private java.util.Map<String,JsonSchema> propertyMap;
+ public java.util.Map<String,JsonSchema> getPropertyMap() {
+ return this.propertyMap;
+ }
+
+ public static class Builder implements JsonSchemaMap.Builder {
+ private final JsonSchemaGModel instance;
+
+ public Builder(JsonSchemaGModel instance) {
+ this.instance = instance;
+ }
+ java.util.Map<String,JsonSchema> propertyMap = new java.util.HashMap<>();
+
+ public Builder propertyMap(java.util.Map<String,JsonSchema> propertyMap) {
+ this.propertyMap.putAll(propertyMap);
+ return this;
+ }
+
+ public Builder propertyMap(String key, JsonSchema value) {
+ this.propertyMap.put(key,value);
+ return this;
+ }
+
+ public Builder propertyMap(String key, java.util.function.Function<JsonSchema.Builder,JsonSchema> provider) {
+ this.propertyMap.put(key,provider.apply( new GsonJsonSchemaImpl.Builder(instance) ) );
+ return this;
+ }
+
+ public Builder propertyMap(java.util.function.Function<JsonSchemaGModel,java.util.Map<String,JsonSchema>> provider) {
+ this.propertyMap.putAll(provider.apply( instance ) );
+ return this;
+ }
+
+ public JsonSchemaMap build() {
+ return new GsonJsonSchemaMapImpl(propertyMap);
+ }
+ }
+}
diff --git a/bundles/runtime/org.eclipse.fx.json.schema/src/org/eclipse/fx/json/schema/JsonSchema.gmod b/bundles/runtime/org.eclipse.fx.json.schema/src/org/eclipse/fx/json/schema/JsonSchema.gmod
index 8559630d1..2152e3bbd 100644
--- a/bundles/runtime/org.eclipse.fx.json.schema/src/org/eclipse/fx/json/schema/JsonSchema.gmod
+++ b/bundles/runtime/org.eclipse.fx.json.schema/src/org/eclipse/fx/json/schema/JsonSchema.gmod
@@ -14,7 +14,7 @@ package org.eclipse.fx.json.schema {
// minLength
// pattern
// additionalItems
- // items
+ JsonSchema items;
// maxItems
// minItems
// uniqueItems

Back to the top