Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2015-11-25 23:32:31 +0000
committerTom Schindl2015-11-25 23:32:31 +0000
commita6dc36f31f992a6b4c1b3fbbd1b4e8a1897e1785 (patch)
tree2d6b9055743580257ce181cb9d6849053247ecf2
parent6bba38d194f90ef28a6500ada1eddf547b8e8c26 (diff)
downloadorg.eclipse.efxclipse-a6dc36f31f992a6b4c1b3fbbd1b4e8a1897e1785.tar.gz
org.eclipse.efxclipse-a6dc36f31f992a6b4c1b3fbbd1b4e8a1897e1785.tar.xz
org.eclipse.efxclipse-a6dc36f31f992a6b4c1b3fbbd1b4e8a1897e1785.zip
Bug 483038 - Allow to configures editor highlightings based on JSON
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/.gitignore13
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonBase.java22
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonElementFactory.java345
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonLanguageDefImpl.java80
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonPartitionImpl.java124
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonPartitionRuleImpl.java51
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonPartitionRule_MultiLineImpl.java96
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonPartitionRule_SingleLineImpl.java96
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenImpl.java95
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScannerImpl.java51
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScanner_CharacterRuleImpl.java71
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScanner_KeywordImpl.java71
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScanner_PatternRuleImpl.java96
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScanner_SingleLineRuleImpl.java96
14 files changed, 1294 insertions, 13 deletions
diff --git a/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/.gitignore b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/.gitignore
deleted file mode 100644
index 2634719a9..000000000
--- a/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/.gitignore
+++ /dev/null
@@ -1,13 +0,0 @@
-/GsonBase.java
-/GsonElementFactory.java
-/GsonLanguageDefImpl.java
-/GsonPartitionImpl.java
-/GsonPartitionRuleImpl.java
-/GsonPartitionRule_MultiLineImpl.java
-/GsonPartitionRule_SingleLineImpl.java
-/GsonTokenImpl.java
-/GsonTokenScannerImpl.java
-/GsonTokenScanner_CharacterRuleImpl.java
-/GsonTokenScanner_KeywordImpl.java
-/GsonTokenScanner_PatternRuleImpl.java
-/GsonTokenScanner_SingleLineRuleImpl.java
diff --git a/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonBase.java b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonBase.java
new file mode 100644
index 000000000..06ec258b6
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonBase.java
@@ -0,0 +1,22 @@
+package org.eclipse.fx.code.editor.configuration.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/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonElementFactory.java b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonElementFactory.java
new file mode 100644
index 000000000..73e54e859
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonElementFactory.java
@@ -0,0 +1,345 @@
+package org.eclipse.fx.code.editor.configuration.gson;
+
+import org.eclipse.fx.code.editor.configuration.*;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonArray;
+
+public final class GsonElementFactory implements EditorGModel {
+ public static LanguageDef createLanguageDef(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "LanguageDef":
+ return new GsonLanguageDefImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonLanguageDefImpl(o);
+ }
+ }
+ public LanguageDef.Builder LanguageDefBuilder() {
+ return new GsonLanguageDefImpl.Builder(this);
+ }
+
+ public static Partition createPartition(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "Partition":
+ return new GsonPartitionImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonPartitionImpl(o);
+ }
+ }
+ public Partition.Builder PartitionBuilder() {
+ return new GsonPartitionImpl.Builder(this);
+ }
+
+ public static PartitionRule createPartitionRule(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "PartitionRule":
+ return new GsonPartitionRuleImpl(o);
+ case "PartitionRule_MultiLine":
+ return new GsonPartitionRule_MultiLineImpl(o);
+ case "PartitionRule_SingleLine":
+ return new GsonPartitionRule_SingleLineImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonPartitionRuleImpl(o);
+ }
+ }
+ public PartitionRule.Builder PartitionRuleBuilder() {
+ return new GsonPartitionRuleImpl.Builder(this);
+ }
+
+ public static PartitionRule_MultiLine createPartitionRule_MultiLine(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "PartitionRule_MultiLine":
+ return new GsonPartitionRule_MultiLineImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonPartitionRule_MultiLineImpl(o);
+ }
+ }
+ public PartitionRule_MultiLine.Builder PartitionRule_MultiLineBuilder() {
+ return new GsonPartitionRule_MultiLineImpl.Builder(this);
+ }
+
+ public static PartitionRule_SingleLine createPartitionRule_SingleLine(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "PartitionRule_SingleLine":
+ return new GsonPartitionRule_SingleLineImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonPartitionRule_SingleLineImpl(o);
+ }
+ }
+ public PartitionRule_SingleLine.Builder PartitionRule_SingleLineBuilder() {
+ return new GsonPartitionRule_SingleLineImpl.Builder(this);
+ }
+
+ public static PartitionWhiteSpace createPartitionWhiteSpace(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "PartitionWhiteSpace":
+ return new GsonPartitionWhiteSpaceImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonPartitionWhiteSpaceImpl(o);
+ }
+ }
+ public PartitionWhiteSpace.Builder PartitionWhiteSpaceBuilder() {
+ return new GsonPartitionWhiteSpaceImpl.Builder(this);
+ }
+
+ public static Token createToken(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "Token":
+ return new GsonTokenImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonTokenImpl(o);
+ }
+ }
+ public Token.Builder TokenBuilder() {
+ return new GsonTokenImpl.Builder(this);
+ }
+
+ public static TokenScanner createTokenScanner(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "TokenScanner":
+ return new GsonTokenScannerImpl(o);
+ case "TokenScanner_CharacterRule":
+ return new GsonTokenScanner_CharacterRuleImpl(o);
+ case "TokenScanner_Keyword":
+ return new GsonTokenScanner_KeywordImpl(o);
+ case "TokenScanner_PatternRule":
+ return new GsonTokenScanner_PatternRuleImpl(o);
+ case "TokenScanner_SingleLineRule":
+ return new GsonTokenScanner_SingleLineRuleImpl(o);
+ case "TokenScanner_MultiLineRule":
+ return new GsonTokenScanner_MultiLineRuleImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonTokenScannerImpl(o);
+ }
+ }
+ public TokenScanner.Builder TokenScannerBuilder() {
+ return new GsonTokenScannerImpl.Builder(this);
+ }
+
+ public static TokenScanner_CharacterRule createTokenScanner_CharacterRule(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "TokenScanner_CharacterRule":
+ return new GsonTokenScanner_CharacterRuleImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonTokenScanner_CharacterRuleImpl(o);
+ }
+ }
+ public TokenScanner_CharacterRule.Builder TokenScanner_CharacterRuleBuilder() {
+ return new GsonTokenScanner_CharacterRuleImpl.Builder(this);
+ }
+
+ public static TokenScanner_Keyword createTokenScanner_Keyword(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "TokenScanner_Keyword":
+ return new GsonTokenScanner_KeywordImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonTokenScanner_KeywordImpl(o);
+ }
+ }
+ public TokenScanner_Keyword.Builder TokenScanner_KeywordBuilder() {
+ return new GsonTokenScanner_KeywordImpl.Builder(this);
+ }
+
+ public static TokenScanner_PatternRule createTokenScanner_PatternRule(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "TokenScanner_PatternRule":
+ return new GsonTokenScanner_PatternRuleImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonTokenScanner_PatternRuleImpl(o);
+ }
+ }
+ public TokenScanner_PatternRule.Builder TokenScanner_PatternRuleBuilder() {
+ return new GsonTokenScanner_PatternRuleImpl.Builder(this);
+ }
+
+ public static TokenScanner_SingleLineRule createTokenScanner_SingleLineRule(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "TokenScanner_SingleLineRule":
+ return new GsonTokenScanner_SingleLineRuleImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonTokenScanner_SingleLineRuleImpl(o);
+ }
+ }
+ public TokenScanner_SingleLineRule.Builder TokenScanner_SingleLineRuleBuilder() {
+ return new GsonTokenScanner_SingleLineRuleImpl.Builder(this);
+ }
+
+ public static TokenScanner_MultiLineRule createTokenScanner_MultiLineRule(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "TokenScanner_MultiLineRule":
+ return new GsonTokenScanner_MultiLineRuleImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonTokenScanner_MultiLineRuleImpl(o);
+ }
+ }
+ public TokenScanner_MultiLineRule.Builder TokenScanner_MultiLineRuleBuilder() {
+ return new GsonTokenScanner_MultiLineRuleImpl.Builder(this);
+ }
+
+ public static Check createCheck(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "Check":
+ return new GsonCheckImpl(o);
+ case "Equals":
+ return new GsonEqualsImpl(o);
+ case "Range":
+ return new GsonRangeImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonCheckImpl(o);
+ }
+ }
+ public Check.Builder CheckBuilder() {
+ return new GsonCheckImpl.Builder(this);
+ }
+
+ public static Equals createEquals(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "Equals":
+ return new GsonEqualsImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonEqualsImpl(o);
+ }
+ }
+ public Equals.Builder EqualsBuilder() {
+ return new GsonEqualsImpl.Builder(this);
+ }
+
+ public static Range createRange(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "Range":
+ return new GsonRangeImpl(o);
+ default:
+ throw new IllegalStateException();
+ }
+ } else {
+ return new GsonRangeImpl(o);
+ }
+ }
+ public Range.Builder RangeBuilder() {
+ return new GsonRangeImpl.Builder(this);
+ }
+
+
+
+ public <T extends EditorBase> 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 EditorBase> T _createObject(JsonObject o) {
+ if( o.has("__type") ) {
+ switch( o.get("__type").getAsString() ) {
+ case "LanguageDef":
+ return (T) createLanguageDef(o);
+ case "Partition":
+ return (T) createPartition(o);
+ case "PartitionRule":
+ return (T) createPartitionRule(o);
+ case "PartitionRule_MultiLine":
+ return (T) createPartitionRule_MultiLine(o);
+ case "PartitionRule_SingleLine":
+ return (T) createPartitionRule_SingleLine(o);
+ case "PartitionWhiteSpace":
+ return (T) createPartitionWhiteSpace(o);
+ case "Token":
+ return (T) createToken(o);
+ case "TokenScanner":
+ return (T) createTokenScanner(o);
+ case "TokenScanner_CharacterRule":
+ return (T) createTokenScanner_CharacterRule(o);
+ case "TokenScanner_Keyword":
+ return (T) createTokenScanner_Keyword(o);
+ case "TokenScanner_PatternRule":
+ return (T) createTokenScanner_PatternRule(o);
+ case "TokenScanner_SingleLineRule":
+ return (T) createTokenScanner_SingleLineRule(o);
+ case "TokenScanner_MultiLineRule":
+ return (T) createTokenScanner_MultiLineRule(o);
+ case "Check":
+ return (T) createCheck(o);
+ case "Equals":
+ return (T) createEquals(o);
+ case "Range":
+ return (T) createRange(o);
+ }
+ }
+ throw new IllegalArgumentException();
+ }
+
+ public <T extends EditorBase> 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(EditorBase o) {
+ return new com.google.gson.GsonBuilder().setPrettyPrinting().create().toJson( ((GsonBase)o).toJSONObject() );
+ }
+
+ public String toString(java.util.List<EditorBase> o) {
+ return new com.google.gson.GsonBuilder().setPrettyPrinting().create().toJson( GsonBase.toDomainJsonArray(o) );
+ }
+}
diff --git a/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonLanguageDefImpl.java b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonLanguageDefImpl.java
new file mode 100644
index 000000000..99efac370
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonLanguageDefImpl.java
@@ -0,0 +1,80 @@
+package org.eclipse.fx.code.editor.configuration.gson;
+
+import org.eclipse.fx.code.editor.configuration.*;
+import com.google.gson.JsonObject;
+
+public final class GsonLanguageDefImpl implements GsonBase, LanguageDef {
+ public GsonLanguageDefImpl(JsonObject jsonObject) {
+ this.fileSuffix = jsonObject.has("fileSuffix") ? jsonObject.get("fileSuffix").getAsString() : null;
+ this.partitionList = java.util.Collections.unmodifiableList(java.util.stream.StreamSupport.stream( jsonObject.getAsJsonArray("partitionList").spliterator(), false )
+ .map( e -> GsonElementFactory.createPartition(e.getAsJsonObject())).collect(java.util.stream.Collectors.toList()));
+ }
+
+ public GsonLanguageDefImpl(String fileSuffix, java.util.List<Partition> partitionList) {
+ this.fileSuffix = fileSuffix;
+ this.partitionList = partitionList;
+ }
+
+ public JsonObject toJSONObject() {
+ JsonObject o = new JsonObject();
+ o.addProperty( "__type", "LanguageDef" );
+ o.addProperty( "fileSuffix", getFileSuffix() );
+ o.add( "partitionList", GsonBase.toDomainJsonArray(getPartitionList()) );
+ return o;
+ }
+
+ public String toString() {
+ return getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + " { "
+ + "fileSuffix : " + fileSuffix + ", "
+ + "partitionList : " + partitionList.stream().map( e -> e.getClass().getSimpleName() + "@" + Integer.toHexString(e.hashCode()) ).collect(java.util.stream.Collectors.toList())
+ +" }";
+ }
+
+ private final String fileSuffix;
+ public String getFileSuffix() {
+ return this.fileSuffix;
+ }
+
+
+ private final java.util.List<Partition> partitionList;
+ public java.util.List<Partition> getPartitionList() {
+ return this.partitionList;
+ }
+
+
+ public static class Builder implements LanguageDef.Builder {
+ private final EditorGModel instance;
+
+ public Builder(EditorGModel instance) {
+ this.instance = instance;
+ }
+
+ private String fileSuffix;
+ public Builder fileSuffix(String fileSuffix) {
+ this.fileSuffix = fileSuffix;
+ return this;
+ }
+ private final java.util.List<Partition> partitionList = new java.util.ArrayList<>();
+ public Builder partitionList(java.util.List<Partition> partitionList) {
+ this.partitionList.addAll(partitionList);
+ return this;
+ }
+ public Builder appendPartitionList(Partition partitionList) {
+ this.partitionList.add(partitionList);
+ return this;
+ }
+ public Builder partitionList(java.util.function.Function<EditorGModel,java.util.List<Partition>> provider) {
+ partitionList( provider.apply( instance ) );
+ return this;
+ }
+
+ public Builder appendPartitionList(java.util.function.Function<Partition.Builder,Partition> provider) {
+ appendPartitionList( provider.apply( new GsonPartitionImpl.Builder(instance) ) );
+ return this;
+ }
+
+ public LanguageDef build() {
+ return new GsonLanguageDefImpl(fileSuffix, partitionList);
+ }
+ }
+}
diff --git a/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonPartitionImpl.java b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonPartitionImpl.java
new file mode 100644
index 000000000..832a589cb
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonPartitionImpl.java
@@ -0,0 +1,124 @@
+package org.eclipse.fx.code.editor.configuration.gson;
+
+import org.eclipse.fx.code.editor.configuration.*;
+import com.google.gson.JsonObject;
+
+public final class GsonPartitionImpl implements GsonBase, Partition {
+ public GsonPartitionImpl(JsonObject jsonObject) {
+ this.name = jsonObject.has("name") ? jsonObject.get("name").getAsString() : null;
+ this.ruleList = java.util.Collections.unmodifiableList(java.util.stream.StreamSupport.stream( jsonObject.getAsJsonArray("ruleList").spliterator(), false )
+ .map( e -> GsonElementFactory.createPartitionRule(e.getAsJsonObject())).collect(java.util.stream.Collectors.toList()));
+ this.tokenList = java.util.Collections.unmodifiableList(java.util.stream.StreamSupport.stream( jsonObject.getAsJsonArray("tokenList").spliterator(), false )
+ .map( e -> GsonElementFactory.createToken(e.getAsJsonObject())).collect(java.util.stream.Collectors.toList()));
+ this.whitespace = jsonObject.has("whitespace") ? GsonElementFactory.createPartitionWhiteSpace(jsonObject.getAsJsonObject("whitespace")) : null;
+ }
+
+ public GsonPartitionImpl(String name, java.util.List<PartitionRule> ruleList, java.util.List<Token> tokenList, PartitionWhiteSpace whitespace) {
+ this.name = name;
+ this.ruleList = ruleList;
+ this.tokenList = tokenList;
+ this.whitespace = whitespace;
+ }
+
+ public JsonObject toJSONObject() {
+ JsonObject o = new JsonObject();
+ o.addProperty( "__type", "Partition" );
+ o.addProperty( "name", getName() );
+ o.add( "ruleList", GsonBase.toDomainJsonArray(getRuleList()) );
+ o.add( "tokenList", GsonBase.toDomainJsonArray(getTokenList()) );
+ o.add( "whitespace", getWhitespace() == null ? null : ((GsonBase)getWhitespace()).toJSONObject() );
+ return o;
+ }
+
+ public String toString() {
+ return getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + " { "
+ + "name : " + name + ", "
+ + "ruleList : " + ruleList.stream().map( e -> e.getClass().getSimpleName() + "@" + Integer.toHexString(e.hashCode()) ).collect(java.util.stream.Collectors.toList()) + ", "
+ + "tokenList : " + tokenList.stream().map( e -> e.getClass().getSimpleName() + "@" + Integer.toHexString(e.hashCode()) ).collect(java.util.stream.Collectors.toList()) + ", "
+ + "whitespace : " + whitespace == null ? null : whitespace.getClass().getSimpleName() + "@" + Integer.toHexString(whitespace.hashCode())
+ +" }";
+ }
+
+ private final String name;
+ public String getName() {
+ return this.name;
+ }
+
+
+ private final java.util.List<PartitionRule> ruleList;
+ public java.util.List<PartitionRule> getRuleList() {
+ return this.ruleList;
+ }
+
+
+ private final java.util.List<Token> tokenList;
+ public java.util.List<Token> getTokenList() {
+ return this.tokenList;
+ }
+
+
+ private final PartitionWhiteSpace whitespace;
+ public PartitionWhiteSpace getWhitespace() {
+ return this.whitespace;
+ }
+
+
+ public static class Builder implements Partition.Builder {
+ private final EditorGModel instance;
+
+ public Builder(EditorGModel instance) {
+ this.instance = instance;
+ }
+
+ private String name;
+ public Builder name(String name) {
+ this.name = name;
+ return this;
+ }
+ private final java.util.List<PartitionRule> ruleList = new java.util.ArrayList<>();
+ public Builder ruleList(java.util.List<PartitionRule> ruleList) {
+ this.ruleList.addAll(ruleList);
+ return this;
+ }
+ public Builder appendRuleList(PartitionRule ruleList) {
+ this.ruleList.add(ruleList);
+ return this;
+ }
+ public Builder ruleList(java.util.function.Function<EditorGModel,java.util.List<PartitionRule>> provider) {
+ ruleList( provider.apply( instance ) );
+ return this;
+ }
+
+ public Builder appendRuleList(java.util.function.Function<PartitionRule.Builder,PartitionRule> provider) {
+ appendRuleList( provider.apply( new GsonPartitionRuleImpl.Builder(instance) ) );
+ return this;
+ }
+ private final java.util.List<Token> tokenList = new java.util.ArrayList<>();
+ public Builder tokenList(java.util.List<Token> tokenList) {
+ this.tokenList.addAll(tokenList);
+ return this;
+ }
+ public Builder appendTokenList(Token tokenList) {
+ this.tokenList.add(tokenList);
+ return this;
+ }
+ public Builder tokenList(java.util.function.Function<EditorGModel,java.util.List<Token>> provider) {
+ tokenList( provider.apply( instance ) );
+ return this;
+ }
+
+ public Builder appendTokenList(java.util.function.Function<Token.Builder,Token> provider) {
+ appendTokenList( provider.apply( new GsonTokenImpl.Builder(instance) ) );
+ return this;
+ }
+ private PartitionWhiteSpace whitespace;
+ public Builder whitespace(PartitionWhiteSpace whitespace) {
+ this.whitespace = whitespace;
+ return this;
+ }
+
+ public Partition build() {
+ return new GsonPartitionImpl(name, ruleList, tokenList, whitespace);
+ }
+ }
+}
diff --git a/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonPartitionRuleImpl.java b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonPartitionRuleImpl.java
new file mode 100644
index 000000000..2522c8520
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonPartitionRuleImpl.java
@@ -0,0 +1,51 @@
+package org.eclipse.fx.code.editor.configuration.gson;
+
+import org.eclipse.fx.code.editor.configuration.*;
+import com.google.gson.JsonObject;
+
+public final class GsonPartitionRuleImpl implements GsonBase, PartitionRule {
+ public GsonPartitionRuleImpl(JsonObject jsonObject) {
+ this.check = jsonObject.has("check") ? GsonElementFactory.createCheck(jsonObject.getAsJsonObject("check")) : null;
+ }
+
+ public GsonPartitionRuleImpl(Check check) {
+ this.check = check;
+ }
+
+ public JsonObject toJSONObject() {
+ JsonObject o = new JsonObject();
+ o.addProperty( "__type", "PartitionRule" );
+ o.add( "check", getCheck() == null ? null : ((GsonBase)getCheck()).toJSONObject() );
+ return o;
+ }
+
+ public String toString() {
+ return getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + " { "
+ + "check : " + check == null ? null : check.getClass().getSimpleName() + "@" + Integer.toHexString(check.hashCode())
+ +" }";
+ }
+
+ private final Check check;
+ public Check getCheck() {
+ return this.check;
+ }
+
+
+ public static class Builder implements PartitionRule.Builder {
+ private final EditorGModel instance;
+
+ public Builder(EditorGModel instance) {
+ this.instance = instance;
+ }
+
+ private Check check;
+ public Builder check(Check check) {
+ this.check = check;
+ return this;
+ }
+
+ public PartitionRule build() {
+ return new GsonPartitionRuleImpl(check);
+ }
+ }
+}
diff --git a/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonPartitionRule_MultiLineImpl.java b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonPartitionRule_MultiLineImpl.java
new file mode 100644
index 000000000..b864ca78e
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonPartitionRule_MultiLineImpl.java
@@ -0,0 +1,96 @@
+package org.eclipse.fx.code.editor.configuration.gson;
+
+import org.eclipse.fx.code.editor.configuration.*;
+import com.google.gson.JsonObject;
+
+public final class GsonPartitionRule_MultiLineImpl implements GsonBase, PartitionRule_MultiLine, PartitionRule {
+ public GsonPartitionRule_MultiLineImpl(JsonObject jsonObject) {
+ this.check = jsonObject.has("check") ? GsonElementFactory.createCheck(jsonObject.getAsJsonObject("check")) : null;
+ this.endSeq = jsonObject.has("endSeq") ? jsonObject.get("endSeq").getAsString() : null;
+ this.escapedBy = jsonObject.has("escapedBy") ? jsonObject.get("escapedBy").getAsString() : null;
+ this.startSeq = jsonObject.has("startSeq") ? jsonObject.get("startSeq").getAsString() : null;
+ }
+
+ public GsonPartitionRule_MultiLineImpl(Check check, String endSeq, String escapedBy, String startSeq) {
+ this.check = check;
+ this.endSeq = endSeq;
+ this.escapedBy = escapedBy;
+ this.startSeq = startSeq;
+ }
+
+ public JsonObject toJSONObject() {
+ JsonObject o = new JsonObject();
+ o.addProperty( "__type", "PartitionRule_MultiLine" );
+ o.add( "check", getCheck() == null ? null : ((GsonBase)getCheck()).toJSONObject() );
+ o.addProperty( "endSeq", getEndSeq() );
+ o.addProperty( "escapedBy", getEscapedBy() );
+ o.addProperty( "startSeq", getStartSeq() );
+ return o;
+ }
+
+ public String toString() {
+ return getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + " { "
+ + "check : " + check == null ? null : check.getClass().getSimpleName() + "@" + Integer.toHexString(check.hashCode()) + ", "
+ + "endSeq : " + endSeq + ", "
+ + "escapedBy : " + escapedBy + ", "
+ + "startSeq : " + startSeq
+ +" }";
+ }
+
+ private final Check check;
+ public Check getCheck() {
+ return this.check;
+ }
+
+
+ private final String endSeq;
+ public String getEndSeq() {
+ return this.endSeq;
+ }
+
+
+ private final String escapedBy;
+ public String getEscapedBy() {
+ return this.escapedBy;
+ }
+
+
+ private final String startSeq;
+ public String getStartSeq() {
+ return this.startSeq;
+ }
+
+
+ public static class Builder implements PartitionRule_MultiLine.Builder {
+ private final EditorGModel instance;
+
+ public Builder(EditorGModel instance) {
+ this.instance = instance;
+ }
+
+ private Check check;
+ public Builder check(Check check) {
+ this.check = check;
+ return this;
+ }
+ private String endSeq;
+ public Builder endSeq(String endSeq) {
+ this.endSeq = endSeq;
+ return this;
+ }
+ private String escapedBy;
+ public Builder escapedBy(String escapedBy) {
+ this.escapedBy = escapedBy;
+ return this;
+ }
+ private String startSeq;
+ public Builder startSeq(String startSeq) {
+ this.startSeq = startSeq;
+ return this;
+ }
+
+ public PartitionRule_MultiLine build() {
+ return new GsonPartitionRule_MultiLineImpl(check, endSeq, escapedBy, startSeq);
+ }
+ }
+}
diff --git a/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonPartitionRule_SingleLineImpl.java b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonPartitionRule_SingleLineImpl.java
new file mode 100644
index 000000000..d5d399483
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonPartitionRule_SingleLineImpl.java
@@ -0,0 +1,96 @@
+package org.eclipse.fx.code.editor.configuration.gson;
+
+import org.eclipse.fx.code.editor.configuration.*;
+import com.google.gson.JsonObject;
+
+public final class GsonPartitionRule_SingleLineImpl implements GsonBase, PartitionRule_SingleLine, PartitionRule {
+ public GsonPartitionRule_SingleLineImpl(JsonObject jsonObject) {
+ this.check = jsonObject.has("check") ? GsonElementFactory.createCheck(jsonObject.getAsJsonObject("check")) : null;
+ this.endSeq = jsonObject.has("endSeq") ? jsonObject.get("endSeq").getAsString() : null;
+ this.escapedBy = jsonObject.has("escapedBy") ? jsonObject.get("escapedBy").getAsString() : null;
+ this.startSeq = jsonObject.has("startSeq") ? jsonObject.get("startSeq").getAsString() : null;
+ }
+
+ public GsonPartitionRule_SingleLineImpl(Check check, String endSeq, String escapedBy, String startSeq) {
+ this.check = check;
+ this.endSeq = endSeq;
+ this.escapedBy = escapedBy;
+ this.startSeq = startSeq;
+ }
+
+ public JsonObject toJSONObject() {
+ JsonObject o = new JsonObject();
+ o.addProperty( "__type", "PartitionRule_SingleLine" );
+ o.add( "check", getCheck() == null ? null : ((GsonBase)getCheck()).toJSONObject() );
+ o.addProperty( "endSeq", getEndSeq() );
+ o.addProperty( "escapedBy", getEscapedBy() );
+ o.addProperty( "startSeq", getStartSeq() );
+ return o;
+ }
+
+ public String toString() {
+ return getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + " { "
+ + "check : " + check == null ? null : check.getClass().getSimpleName() + "@" + Integer.toHexString(check.hashCode()) + ", "
+ + "endSeq : " + endSeq + ", "
+ + "escapedBy : " + escapedBy + ", "
+ + "startSeq : " + startSeq
+ +" }";
+ }
+
+ private final Check check;
+ public Check getCheck() {
+ return this.check;
+ }
+
+
+ private final String endSeq;
+ public String getEndSeq() {
+ return this.endSeq;
+ }
+
+
+ private final String escapedBy;
+ public String getEscapedBy() {
+ return this.escapedBy;
+ }
+
+
+ private final String startSeq;
+ public String getStartSeq() {
+ return this.startSeq;
+ }
+
+
+ public static class Builder implements PartitionRule_SingleLine.Builder {
+ private final EditorGModel instance;
+
+ public Builder(EditorGModel instance) {
+ this.instance = instance;
+ }
+
+ private Check check;
+ public Builder check(Check check) {
+ this.check = check;
+ return this;
+ }
+ private String endSeq;
+ public Builder endSeq(String endSeq) {
+ this.endSeq = endSeq;
+ return this;
+ }
+ private String escapedBy;
+ public Builder escapedBy(String escapedBy) {
+ this.escapedBy = escapedBy;
+ return this;
+ }
+ private String startSeq;
+ public Builder startSeq(String startSeq) {
+ this.startSeq = startSeq;
+ return this;
+ }
+
+ public PartitionRule_SingleLine build() {
+ return new GsonPartitionRule_SingleLineImpl(check, endSeq, escapedBy, startSeq);
+ }
+ }
+}
diff --git a/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenImpl.java b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenImpl.java
new file mode 100644
index 000000000..597e3b5de
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenImpl.java
@@ -0,0 +1,95 @@
+package org.eclipse.fx.code.editor.configuration.gson;
+
+import org.eclipse.fx.code.editor.configuration.*;
+import com.google.gson.JsonObject;
+
+public final class GsonTokenImpl implements GsonBase, Token {
+ public GsonTokenImpl(JsonObject jsonObject) {
+ this.defaultToken = jsonObject.has("defaultToken") ? jsonObject.get("defaultToken").getAsBoolean() : false;
+ this.name = jsonObject.has("name") ? jsonObject.get("name").getAsString() : null;
+ this.tokenScannerList = java.util.Collections.unmodifiableList(java.util.stream.StreamSupport.stream( jsonObject.getAsJsonArray("tokenScannerList").spliterator(), false )
+ .map( e -> GsonElementFactory.createTokenScanner(e.getAsJsonObject())).collect(java.util.stream.Collectors.toList()));
+ }
+
+ public GsonTokenImpl(boolean defaultToken, String name, java.util.List<TokenScanner> tokenScannerList) {
+ this.defaultToken = defaultToken;
+ this.name = name;
+ this.tokenScannerList = tokenScannerList;
+ }
+
+ public JsonObject toJSONObject() {
+ JsonObject o = new JsonObject();
+ o.addProperty( "__type", "Token" );
+ o.addProperty( "defaultToken", isDefaultToken() );
+ o.addProperty( "name", getName() );
+ o.add( "tokenScannerList", GsonBase.toDomainJsonArray(getTokenScannerList()) );
+ return o;
+ }
+
+ public String toString() {
+ return getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + " { "
+ + "defaultToken : " + defaultToken + ", "
+ + "name : " + name + ", "
+ + "tokenScannerList : " + tokenScannerList.stream().map( e -> e.getClass().getSimpleName() + "@" + Integer.toHexString(e.hashCode()) ).collect(java.util.stream.Collectors.toList())
+ +" }";
+ }
+
+ private final boolean defaultToken;
+ public boolean isDefaultToken() {
+ return this.defaultToken;
+ }
+
+
+ private final String name;
+ public String getName() {
+ return this.name;
+ }
+
+
+ private final java.util.List<TokenScanner> tokenScannerList;
+ public java.util.List<TokenScanner> getTokenScannerList() {
+ return this.tokenScannerList;
+ }
+
+
+ public static class Builder implements Token.Builder {
+ private final EditorGModel instance;
+
+ public Builder(EditorGModel instance) {
+ this.instance = instance;
+ }
+
+ private boolean defaultToken;
+ public Builder defaultToken(boolean defaultToken) {
+ this.defaultToken = defaultToken;
+ return this;
+ }
+ private String name;
+ public Builder name(String name) {
+ this.name = name;
+ return this;
+ }
+ private final java.util.List<TokenScanner> tokenScannerList = new java.util.ArrayList<>();
+ public Builder tokenScannerList(java.util.List<TokenScanner> tokenScannerList) {
+ this.tokenScannerList.addAll(tokenScannerList);
+ return this;
+ }
+ public Builder appendTokenScannerList(TokenScanner tokenScannerList) {
+ this.tokenScannerList.add(tokenScannerList);
+ return this;
+ }
+ public Builder tokenScannerList(java.util.function.Function<EditorGModel,java.util.List<TokenScanner>> provider) {
+ tokenScannerList( provider.apply( instance ) );
+ return this;
+ }
+
+ public Builder appendTokenScannerList(java.util.function.Function<TokenScanner.Builder,TokenScanner> provider) {
+ appendTokenScannerList( provider.apply( new GsonTokenScannerImpl.Builder(instance) ) );
+ return this;
+ }
+
+ public Token build() {
+ return new GsonTokenImpl(defaultToken, name, tokenScannerList);
+ }
+ }
+}
diff --git a/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScannerImpl.java b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScannerImpl.java
new file mode 100644
index 000000000..79ef984a8
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScannerImpl.java
@@ -0,0 +1,51 @@
+package org.eclipse.fx.code.editor.configuration.gson;
+
+import org.eclipse.fx.code.editor.configuration.*;
+import com.google.gson.JsonObject;
+
+public final class GsonTokenScannerImpl implements GsonBase, TokenScanner {
+ public GsonTokenScannerImpl(JsonObject jsonObject) {
+ this.check = jsonObject.has("check") ? GsonElementFactory.createCheck(jsonObject.getAsJsonObject("check")) : null;
+ }
+
+ public GsonTokenScannerImpl(Check check) {
+ this.check = check;
+ }
+
+ public JsonObject toJSONObject() {
+ JsonObject o = new JsonObject();
+ o.addProperty( "__type", "TokenScanner" );
+ o.add( "check", getCheck() == null ? null : ((GsonBase)getCheck()).toJSONObject() );
+ return o;
+ }
+
+ public String toString() {
+ return getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + " { "
+ + "check : " + check == null ? null : check.getClass().getSimpleName() + "@" + Integer.toHexString(check.hashCode())
+ +" }";
+ }
+
+ private final Check check;
+ public Check getCheck() {
+ return this.check;
+ }
+
+
+ public static class Builder implements TokenScanner.Builder {
+ private final EditorGModel instance;
+
+ public Builder(EditorGModel instance) {
+ this.instance = instance;
+ }
+
+ private Check check;
+ public Builder check(Check check) {
+ this.check = check;
+ return this;
+ }
+
+ public TokenScanner build() {
+ return new GsonTokenScannerImpl(check);
+ }
+ }
+}
diff --git a/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScanner_CharacterRuleImpl.java b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScanner_CharacterRuleImpl.java
new file mode 100644
index 000000000..fa6f924c2
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScanner_CharacterRuleImpl.java
@@ -0,0 +1,71 @@
+package org.eclipse.fx.code.editor.configuration.gson;
+
+import org.eclipse.fx.code.editor.configuration.*;
+import com.google.gson.JsonObject;
+
+public final class GsonTokenScanner_CharacterRuleImpl implements GsonBase, TokenScanner_CharacterRule, TokenScanner {
+ public GsonTokenScanner_CharacterRuleImpl(JsonObject jsonObject) {
+ this.characterList = java.util.Collections.unmodifiableList(java.util.stream.StreamSupport.stream( jsonObject.getAsJsonArray("characterList").spliterator(), false )
+ .map( e -> e.getAsString()).collect(java.util.stream.Collectors.toList()));
+ this.check = jsonObject.has("check") ? GsonElementFactory.createCheck(jsonObject.getAsJsonObject("check")) : null;
+ }
+
+ public GsonTokenScanner_CharacterRuleImpl(java.util.List<String> characterList, Check check) {
+ this.characterList = characterList;
+ this.check = check;
+ }
+
+ public JsonObject toJSONObject() {
+ JsonObject o = new JsonObject();
+ o.addProperty( "__type", "TokenScanner_CharacterRule" );
+ o.add( "characterList", GsonBase.toJsonArray(getCharacterList().stream().map(com.google.gson.JsonPrimitive::new).collect(java.util.stream.Collectors.toList())) );
+ o.add( "check", getCheck() == null ? null : ((GsonBase)getCheck()).toJSONObject() );
+ return o;
+ }
+
+ public String toString() {
+ return getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + " { "
+ + "characterList : " + characterList + ", "
+ + "check : " + check == null ? null : check.getClass().getSimpleName() + "@" + Integer.toHexString(check.hashCode())
+ +" }";
+ }
+
+ private final java.util.List<String> characterList;
+ public java.util.List<String> getCharacterList() {
+ return this.characterList;
+ }
+
+
+ private final Check check;
+ public Check getCheck() {
+ return this.check;
+ }
+
+
+ public static class Builder implements TokenScanner_CharacterRule.Builder {
+ private final EditorGModel instance;
+
+ public Builder(EditorGModel instance) {
+ this.instance = instance;
+ }
+
+ private final java.util.List<String> characterList = new java.util.ArrayList<>();
+ public Builder characterList(java.util.List<String> characterList) {
+ this.characterList.addAll(characterList);
+ return this;
+ }
+ public Builder appendCharacterList(String characterList) {
+ this.characterList.add(characterList);
+ return this;
+ }
+ private Check check;
+ public Builder check(Check check) {
+ this.check = check;
+ return this;
+ }
+
+ public TokenScanner_CharacterRule build() {
+ return new GsonTokenScanner_CharacterRuleImpl(characterList, check);
+ }
+ }
+}
diff --git a/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScanner_KeywordImpl.java b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScanner_KeywordImpl.java
new file mode 100644
index 000000000..6ae6f9a51
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScanner_KeywordImpl.java
@@ -0,0 +1,71 @@
+package org.eclipse.fx.code.editor.configuration.gson;
+
+import org.eclipse.fx.code.editor.configuration.*;
+import com.google.gson.JsonObject;
+
+public final class GsonTokenScanner_KeywordImpl implements GsonBase, TokenScanner_Keyword, TokenScanner {
+ public GsonTokenScanner_KeywordImpl(JsonObject jsonObject) {
+ this.check = jsonObject.has("check") ? GsonElementFactory.createCheck(jsonObject.getAsJsonObject("check")) : null;
+ this.keywordList = java.util.Collections.unmodifiableList(java.util.stream.StreamSupport.stream( jsonObject.getAsJsonArray("keywordList").spliterator(), false )
+ .map( e -> e.getAsString()).collect(java.util.stream.Collectors.toList()));
+ }
+
+ public GsonTokenScanner_KeywordImpl(Check check, java.util.List<String> keywordList) {
+ this.check = check;
+ this.keywordList = keywordList;
+ }
+
+ public JsonObject toJSONObject() {
+ JsonObject o = new JsonObject();
+ o.addProperty( "__type", "TokenScanner_Keyword" );
+ o.add( "check", getCheck() == null ? null : ((GsonBase)getCheck()).toJSONObject() );
+ o.add( "keywordList", GsonBase.toJsonArray(getKeywordList().stream().map(com.google.gson.JsonPrimitive::new).collect(java.util.stream.Collectors.toList())) );
+ return o;
+ }
+
+ public String toString() {
+ return getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + " { "
+ + "check : " + check == null ? null : check.getClass().getSimpleName() + "@" + Integer.toHexString(check.hashCode()) + ", "
+ + "keywordList : " + keywordList
+ +" }";
+ }
+
+ private final Check check;
+ public Check getCheck() {
+ return this.check;
+ }
+
+
+ private final java.util.List<String> keywordList;
+ public java.util.List<String> getKeywordList() {
+ return this.keywordList;
+ }
+
+
+ public static class Builder implements TokenScanner_Keyword.Builder {
+ private final EditorGModel instance;
+
+ public Builder(EditorGModel instance) {
+ this.instance = instance;
+ }
+
+ private Check check;
+ public Builder check(Check check) {
+ this.check = check;
+ return this;
+ }
+ private final java.util.List<String> keywordList = new java.util.ArrayList<>();
+ public Builder keywordList(java.util.List<String> keywordList) {
+ this.keywordList.addAll(keywordList);
+ return this;
+ }
+ public Builder appendKeywordList(String keywordList) {
+ this.keywordList.add(keywordList);
+ return this;
+ }
+
+ public TokenScanner_Keyword build() {
+ return new GsonTokenScanner_KeywordImpl(check, keywordList);
+ }
+ }
+}
diff --git a/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScanner_PatternRuleImpl.java b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScanner_PatternRuleImpl.java
new file mode 100644
index 000000000..36b27e2d0
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScanner_PatternRuleImpl.java
@@ -0,0 +1,96 @@
+package org.eclipse.fx.code.editor.configuration.gson;
+
+import org.eclipse.fx.code.editor.configuration.*;
+import com.google.gson.JsonObject;
+
+public final class GsonTokenScanner_PatternRuleImpl implements GsonBase, TokenScanner_PatternRule, TokenScanner {
+ public GsonTokenScanner_PatternRuleImpl(JsonObject jsonObject) {
+ this.check = jsonObject.has("check") ? GsonElementFactory.createCheck(jsonObject.getAsJsonObject("check")) : null;
+ this.containmentPattern = jsonObject.has("containmentPattern") ? jsonObject.get("containmentPattern").getAsString() : null;
+ this.startLength = jsonObject.has("startLength") ? jsonObject.get("startLength").getAsInt() : 1;
+ this.startPattern = jsonObject.has("startPattern") ? jsonObject.get("startPattern").getAsString() : null;
+ }
+
+ public GsonTokenScanner_PatternRuleImpl(Check check, String containmentPattern, int startLength, String startPattern) {
+ this.check = check;
+ this.containmentPattern = containmentPattern;
+ this.startLength = startLength;
+ this.startPattern = startPattern;
+ }
+
+ public JsonObject toJSONObject() {
+ JsonObject o = new JsonObject();
+ o.addProperty( "__type", "TokenScanner_PatternRule" );
+ o.add( "check", getCheck() == null ? null : ((GsonBase)getCheck()).toJSONObject() );
+ o.addProperty( "containmentPattern", getContainmentPattern() );
+ o.addProperty( "startLength", getStartLength() );
+ o.addProperty( "startPattern", getStartPattern() );
+ return o;
+ }
+
+ public String toString() {
+ return getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + " { "
+ + "check : " + check == null ? null : check.getClass().getSimpleName() + "@" + Integer.toHexString(check.hashCode()) + ", "
+ + "containmentPattern : " + containmentPattern + ", "
+ + "startLength : " + startLength + ", "
+ + "startPattern : " + startPattern
+ +" }";
+ }
+
+ private final Check check;
+ public Check getCheck() {
+ return this.check;
+ }
+
+
+ private final String containmentPattern;
+ public String getContainmentPattern() {
+ return this.containmentPattern;
+ }
+
+
+ private final int startLength;
+ public int getStartLength() {
+ return this.startLength;
+ }
+
+
+ private final String startPattern;
+ public String getStartPattern() {
+ return this.startPattern;
+ }
+
+
+ public static class Builder implements TokenScanner_PatternRule.Builder {
+ private final EditorGModel instance;
+
+ public Builder(EditorGModel instance) {
+ this.instance = instance;
+ }
+
+ private Check check;
+ public Builder check(Check check) {
+ this.check = check;
+ return this;
+ }
+ private String containmentPattern;
+ public Builder containmentPattern(String containmentPattern) {
+ this.containmentPattern = containmentPattern;
+ return this;
+ }
+ private int startLength;
+ public Builder startLength(int startLength) {
+ this.startLength = startLength;
+ return this;
+ }
+ private String startPattern;
+ public Builder startPattern(String startPattern) {
+ this.startPattern = startPattern;
+ return this;
+ }
+
+ public TokenScanner_PatternRule build() {
+ return new GsonTokenScanner_PatternRuleImpl(check, containmentPattern, startLength, startPattern);
+ }
+ }
+}
diff --git a/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScanner_SingleLineRuleImpl.java b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScanner_SingleLineRuleImpl.java
new file mode 100644
index 000000000..c94c37b99
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.code.editor.configuration/src-gen/org/eclipse/fx/code/editor/configuration/gson/GsonTokenScanner_SingleLineRuleImpl.java
@@ -0,0 +1,96 @@
+package org.eclipse.fx.code.editor.configuration.gson;
+
+import org.eclipse.fx.code.editor.configuration.*;
+import com.google.gson.JsonObject;
+
+public final class GsonTokenScanner_SingleLineRuleImpl implements GsonBase, TokenScanner_SingleLineRule, TokenScanner {
+ public GsonTokenScanner_SingleLineRuleImpl(JsonObject jsonObject) {
+ this.check = jsonObject.has("check") ? GsonElementFactory.createCheck(jsonObject.getAsJsonObject("check")) : null;
+ this.endSeq = jsonObject.has("endSeq") ? jsonObject.get("endSeq").getAsString() : null;
+ this.escapedBy = jsonObject.has("escapedBy") ? jsonObject.get("escapedBy").getAsString() : null;
+ this.startSeq = jsonObject.has("startSeq") ? jsonObject.get("startSeq").getAsString() : null;
+ }
+
+ public GsonTokenScanner_SingleLineRuleImpl(Check check, String endSeq, String escapedBy, String startSeq) {
+ this.check = check;
+ this.endSeq = endSeq;
+ this.escapedBy = escapedBy;
+ this.startSeq = startSeq;
+ }
+
+ public JsonObject toJSONObject() {
+ JsonObject o = new JsonObject();
+ o.addProperty( "__type", "TokenScanner_SingleLineRule" );
+ o.add( "check", getCheck() == null ? null : ((GsonBase)getCheck()).toJSONObject() );
+ o.addProperty( "endSeq", getEndSeq() );
+ o.addProperty( "escapedBy", getEscapedBy() );
+ o.addProperty( "startSeq", getStartSeq() );
+ return o;
+ }
+
+ public String toString() {
+ return getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + " { "
+ + "check : " + check == null ? null : check.getClass().getSimpleName() + "@" + Integer.toHexString(check.hashCode()) + ", "
+ + "endSeq : " + endSeq + ", "
+ + "escapedBy : " + escapedBy + ", "
+ + "startSeq : " + startSeq
+ +" }";
+ }
+
+ private final Check check;
+ public Check getCheck() {
+ return this.check;
+ }
+
+
+ private final String endSeq;
+ public String getEndSeq() {
+ return this.endSeq;
+ }
+
+
+ private final String escapedBy;
+ public String getEscapedBy() {
+ return this.escapedBy;
+ }
+
+
+ private final String startSeq;
+ public String getStartSeq() {
+ return this.startSeq;
+ }
+
+
+ public static class Builder implements TokenScanner_SingleLineRule.Builder {
+ private final EditorGModel instance;
+
+ public Builder(EditorGModel instance) {
+ this.instance = instance;
+ }
+
+ private Check check;
+ public Builder check(Check check) {
+ this.check = check;
+ return this;
+ }
+ private String endSeq;
+ public Builder endSeq(String endSeq) {
+ this.endSeq = endSeq;
+ return this;
+ }
+ private String escapedBy;
+ public Builder escapedBy(String escapedBy) {
+ this.escapedBy = escapedBy;
+ return this;
+ }
+ private String startSeq;
+ public Builder startSeq(String startSeq) {
+ this.startSeq = startSeq;
+ return this;
+ }
+
+ public TokenScanner_SingleLineRule build() {
+ return new GsonTokenScanner_SingleLineRuleImpl(check, endSeq, escapedBy, startSeq);
+ }
+ }
+}

Back to the top