Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.java')
-rw-r--r--plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.java590
1 files changed, 244 insertions, 346 deletions
diff --git a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.java b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.java
index 238102d24..1c5ba56ca 100644
--- a/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.java
+++ b/plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.java
@@ -2,27 +2,24 @@ package org.eclipse.etrice.generator.java.gen;
import com.google.common.base.Objects;
import com.google.inject.Inject;
-import java.util.HashSet;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.etrice.core.config.AttrClassConfig;
-import org.eclipse.etrice.core.config.AttrInstanceConfig;
-import org.eclipse.etrice.core.config.LiteralArray;
-import org.eclipse.etrice.core.config.NumberLiteral;
+import org.eclipse.etrice.core.genmodel.etricegen.ActorInstance;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.Attribute;
+import org.eclipse.etrice.core.room.DataClass;
import org.eclipse.etrice.core.room.DataType;
import org.eclipse.etrice.core.room.PrimitiveType;
import org.eclipse.etrice.core.room.RefableType;
-import org.eclipse.etrice.generator.generic.ConfigExtension;
+import org.eclipse.etrice.generator.base.IDataConfiguration;
import org.eclipse.etrice.generator.generic.ProcedureHelpers;
+import org.eclipse.etrice.generator.generic.RoomExtensions;
import org.eclipse.etrice.generator.generic.TypeHelpers;
import org.eclipse.etrice.generator.java.gen.JavaExtensions;
import org.eclipse.xtend2.lib.StringConcatenation;
import org.eclipse.xtext.xbase.lib.Conversions;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
@SuppressWarnings("all")
public class ConfigGenAddon {
@@ -36,409 +33,310 @@ public class ConfigGenAddon {
private ProcedureHelpers helpers;
@Inject
- private ConfigExtension configExt;
+ private IDataConfiguration dataConfigExt;
- public CharSequence applyInstanceConfig(final String instance, final String className, final List<AttrInstanceConfig> attrConfigs) {
+ @Inject
+ private RoomExtensions _roomExtensions;
+
+ public CharSequence genActorInstanceConfig(final ActorInstance ai) {
StringConcatenation _builder = new StringConcatenation();
{
- for(final AttrInstanceConfig attrConfig : attrConfigs) {
- Attribute a = attrConfig.getAttribute();
- _builder.newLineIfNotEmpty();
- RefableType _refType = a.getRefType();
- DataType aType = _refType.getType();
+ ActorClass _actorClass = ai.getActorClass();
+ EList<Attribute> _attributes = _actorClass.getAttributes();
+ for(final Attribute a : _attributes) {
+ String _path = ai.getPath();
+ String _plus = (_path + "/");
+ String _name = a.getName();
+ String _plus_1 = (_plus + _name);
+ CharSequence _applyInstanceConfig = this.applyInstanceConfig(ai, "inst", _plus_1, a);
+ _builder.append(_applyInstanceConfig, "");
_builder.newLineIfNotEmpty();
+ }
+ }
+ return _builder;
+ }
+
+ public CharSequence applyInstanceConfig(final ActorInstance ai, final String invokes, final String instancePath, final Attribute a) {
+ CharSequence _xblockexpression = null;
+ {
+ RefableType _refType = a.getRefType();
+ DataType aType = _refType.getType();
+ CharSequence _xifexpression = null;
+ boolean _isPrimitive = this.typeHelpers.isPrimitive(aType);
+ if (_isPrimitive) {
+ CharSequence _xblockexpression_1 = null;
{
- boolean _isPrimitive = this.typeHelpers.isPrimitive(aType);
- if (_isPrimitive) {
- LiteralArray _value = attrConfig.getValue();
- String[] values = _value==null?(String[])null:this.configExt.getValues(_value);
- _builder.newLineIfNotEmpty();
- {
- boolean _equals = Objects.equal(values, null);
- if (_equals) {
- } else {
- boolean _or = false;
- int _size = a.getSize();
- boolean _equals_1 = (_size == 0);
- if (_equals_1) {
- _or = true;
- } else {
- boolean _isCharacterType = this.typeHelpers.isCharacterType(aType);
- _or = (_equals_1 || _isCharacterType);
- }
- if (_or) {
- _builder.append(instance, "");
- _builder.append(".");
- String _name = a.getName();
- final String[] _converted_values = (String[])values;
- String _get = ((List<String>)Conversions.doWrapArray(_converted_values)).get(0);
- String _valueLiteral = this.stdExt.toValueLiteral(((PrimitiveType) aType), _get);
- CharSequence _invokeSetter = this.helpers.invokeSetter(_name, className, _valueLiteral);
- _builder.append(_invokeSetter, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- } else {
- int _size_1 = a.getSize();
- final String[] _converted_values_1 = (String[])values;
- int _size_2 = ((List<String>)Conversions.doWrapArray(_converted_values_1)).size();
- boolean _equals_2 = (_size_1 == _size_2);
- if (_equals_2) {
- _builder.append(instance, "");
- _builder.append(".");
- String _name_1 = a.getName();
- String _typeName = this.typeHelpers.typeName(aType);
- String _plus = ("new " + _typeName);
- String _plus_1 = (_plus + "[]");
- String _arrayValueLiteral = this.configExt.toArrayValueLiteral(((PrimitiveType) aType), values);
- String _plus_2 = (_plus_1 + _arrayValueLiteral);
- CharSequence _invokeSetter_1 = this.helpers.invokeSetter(_name_1, className, _plus_2);
- _builder.append(_invokeSetter_1, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- } else {
- _builder.append("{");
- _builder.newLine();
- _builder.append("\t");
- String _typeName_1 = this.typeHelpers.typeName(aType);
- _builder.append(_typeName_1, " ");
- _builder.append("[] array = ");
- _builder.append(instance, " ");
- _builder.append(".");
- String _name_2 = a.getName();
- CharSequence _invokeGetter = this.helpers.invokeGetter(_name_2, className);
- _builder.append(_invokeGetter, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("for (int i=0;i<");
- int _size_3 = a.getSize();
- _builder.append(_size_3, " ");
- _builder.append(";i++){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("array[i] = ");
- final String[] _converted_values_2 = (String[])values;
- String _get_1 = ((List<String>)Conversions.doWrapArray(_converted_values_2)).get(0);
- String _valueLiteral_1 = this.stdExt.toValueLiteral(((PrimitiveType) aType), _get_1);
- _builder.append(_valueLiteral_1, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
+ String value = this.dataConfigExt.getAttrInstanceConfigValue(ai, instancePath);
+ CharSequence _xifexpression_1 = null;
+ boolean _equals = Objects.equal(value, null);
+ if (_equals) {
+ StringConcatenation _builder = new StringConcatenation();
+ _xifexpression_1 = _builder;
+ } else {
+ CharSequence _xifexpression_2 = null;
+ boolean _or = false;
+ int _size = a.getSize();
+ boolean _equals_1 = (_size == 0);
+ if (_equals_1) {
+ _or = true;
+ } else {
+ boolean _isCharacterType = this.typeHelpers.isCharacterType(aType);
+ _or = (_equals_1 || _isCharacterType);
+ }
+ if (_or) {
+ StringConcatenation _builder_1 = new StringConcatenation();
+ _builder_1.append(invokes, "");
+ _builder_1.append(".");
+ String _name = a.getName();
+ String _valueLiteral = this.stdExt.toValueLiteral(((PrimitiveType) aType), value);
+ CharSequence _invokeSetter = this.helpers.invokeSetter(_name, null, _valueLiteral);
+ _builder_1.append(_invokeSetter, "");
+ _builder_1.append(";");
+ _xifexpression_2 = _builder_1;
+ } else {
+ CharSequence _xifexpression_3 = null;
+ int _size_1 = a.getSize();
+ String[] _split = value.split(",");
+ int _size_2 = ((List<String>)Conversions.doWrapArray(_split)).size();
+ boolean _equals_2 = (_size_1 == _size_2);
+ if (_equals_2) {
+ CharSequence _xblockexpression_2 = null;
+ {
+ StringConcatenation _builder_2 = new StringConcatenation();
+ {
+ String[] _split_1 = value.split(",");
+ boolean _hasElements = false;
+ for(final String s : _split_1) {
+ if (!_hasElements) {
+ _hasElements = true;
+ } else {
+ _builder_2.appendImmediate(",", "");
+ }
+ String _trim = s.trim();
+ String _valueLiteral_1 = this.stdExt.toValueLiteral(((PrimitiveType) aType), _trim);
+ _builder_2.append(_valueLiteral_1, "");
+ }
}
+ CharSequence arrayExpr = _builder_2;
+ StringConcatenation _builder_3 = new StringConcatenation();
+ _builder_3.append(invokes, "");
+ _builder_3.append(".");
+ String _name_1 = a.getName();
+ StringConcatenation _builder_4 = new StringConcatenation();
+ _builder_4.append("new ");
+ String _typeName = this.typeHelpers.typeName(aType);
+ _builder_4.append(_typeName, "");
+ _builder_4.append("[]");
+ _builder_4.append(arrayExpr, "");
+ String _string = _builder_4.toString();
+ CharSequence _invokeSetter_1 = this.helpers.invokeSetter(_name_1, null, _string);
+ _builder_3.append(_invokeSetter_1, "");
+ _xblockexpression_2 = (_builder_3);
}
+ _xifexpression_3 = _xblockexpression_2;
+ } else {
+ StringConcatenation _builder_2 = new StringConcatenation();
+ _builder_2.append("{");
+ _builder_2.newLine();
+ _builder_2.append("\t\t\t\t\t\t");
+ String _typeName = this.typeHelpers.typeName(aType);
+ _builder_2.append(_typeName, " ");
+ _builder_2.append("[] array = ");
+ _builder_2.append(invokes, " ");
+ _builder_2.append(".");
+ String _name_1 = a.getName();
+ CharSequence _invokeGetter = this.helpers.invokeGetter(_name_1, null);
+ _builder_2.append(_invokeGetter, " ");
+ _builder_2.append(";");
+ _builder_2.newLineIfNotEmpty();
+ _builder_2.append("\t\t\t\t\t\t");
+ _builder_2.append("for (int i=0;i<");
+ int _size_3 = a.getSize();
+ _builder_2.append(_size_3, " ");
+ _builder_2.append(";i++){");
+ _builder_2.newLineIfNotEmpty();
+ _builder_2.append("\t\t\t\t\t\t\t");
+ _builder_2.append("array[i] = ");
+ String _valueLiteral_1 = this.stdExt.toValueLiteral(((PrimitiveType) aType), value);
+ _builder_2.append(_valueLiteral_1, " ");
+ _builder_2.append(";");
+ _builder_2.newLineIfNotEmpty();
+ _builder_2.append("\t\t\t\t\t");
+ _builder_2.append("}");
+ _xifexpression_3 = _builder_2;
}
+ _xifexpression_2 = _xifexpression_3;
}
- } else {
- boolean _isDataClass = this.typeHelpers.isDataClass(aType);
- if (_isDataClass) {
- String _plus_3 = (instance + ".");
- String _name_3 = a.getName();
- CharSequence _invokeGetter_1 = this.helpers.invokeGetter(_name_3, className);
- String _plus_4 = (_plus_3 + _invokeGetter_1);
- String _typeName_2 = this.typeHelpers.typeName(aType);
- EList<AttrInstanceConfig> _attributes = attrConfig.getAttributes();
- CharSequence _applyInstanceConfig = this.applyInstanceConfig(_plus_4, _typeName_2, _attributes);
+ _xifexpression_1 = _xifexpression_2;
+ }
+ _xblockexpression_1 = (_xifexpression_1);
+ }
+ _xifexpression = _xblockexpression_1;
+ } else {
+ CharSequence _xifexpression_1 = null;
+ boolean _isDataClass = this.typeHelpers.isDataClass(aType);
+ if (_isDataClass) {
+ StringConcatenation _builder = new StringConcatenation();
+ {
+ EList<Attribute> _attributes = ((DataClass) aType).getAttributes();
+ for(final Attribute e : _attributes) {
+ _builder.newLineIfNotEmpty();
+ String _plus = (invokes + ".");
+ String _name = a.getName();
+ CharSequence _invokeGetter = this.helpers.invokeGetter(_name, null);
+ String _plus_1 = (_plus + _invokeGetter);
+ String _plus_2 = (instancePath + "/");
+ String _name_1 = e.getName();
+ String _plus_3 = (_plus_2 + _name_1);
+ CharSequence _applyInstanceConfig = this.applyInstanceConfig(ai, _plus_1, _plus_3, e);
_builder.append(_applyInstanceConfig, "");
_builder.newLineIfNotEmpty();
+ _builder.append("\t\t\t\t");
}
}
+ _xifexpression_1 = _builder;
}
+ _xifexpression = _xifexpression_1;
}
+ _xblockexpression = (_xifexpression);
}
- return _builder;
+ return _xblockexpression;
+ }
+
+ public Object genDynConfigGetterSetter(final ActorClass ac) {
+ return null;
}
- public CharSequence genDynConfigGetterSetter(final ActorClass ac) {
+ public CharSequence genMinMaxConstants(final ActorClass ac) {
StringConcatenation _builder = new StringConcatenation();
{
- HashSet<Attribute> _dynConfigAttributes = this.configExt.getDynConfigAttributes(ac, true, false);
- for(final Attribute a : _dynConfigAttributes) {
- _builder.append("public ");
- RefableType _refType = a.getRefType();
- DataType _type = _refType.getType();
- String _typeName = this.typeHelpers.typeName(_type);
- _builder.append(_typeName, "");
- {
- int _size = a.getSize();
- boolean _greaterThan = (_size > 0);
- if (_greaterThan) {
- _builder.append("[]");
- }
- }
- _builder.append(" get");
+ EList<Attribute> _attributes = ac.getAttributes();
+ for(final Attribute a : _attributes) {
String _name = a.getName();
- String _firstUpper = StringExtensions.toFirstUpper(_name);
- _builder.append(_firstUpper, "");
- _builder.append("(){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("if(lock_");
- String _name_1 = a.getName();
- _builder.append(_name_1, " ");
- _builder.append(" == null)");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("return ");
- String _name_2 = a.getName();
- _builder.append(_name_2, " ");
- _builder.append(";");
+ ArrayList<Attribute> _arrayList = new ArrayList<Attribute>();
+ List<Attribute> _union = this._roomExtensions.<Attribute>union(_arrayList, a);
+ CharSequence _genMinMaxConstantsRec = this.genMinMaxConstantsRec(ac, _name, _union);
+ _builder.append(_genMinMaxConstantsRec, "");
_builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("else");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("synchronized(lock_");
- String _name_3 = a.getName();
- _builder.append(_name_3, " ");
- _builder.append("){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("return ");
- String _name_4 = a.getName();
- _builder.append(_name_4, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- _builder.append("public void set");
- String _name_5 = a.getName();
- String _firstUpper_1 = StringExtensions.toFirstUpper(_name_5);
- _builder.append(_firstUpper_1, "");
- _builder.append("(");
- RefableType _refType_1 = a.getRefType();
- DataType _type_1 = _refType_1.getType();
- String _typeName_1 = this.typeHelpers.typeName(_type_1);
- _builder.append(_typeName_1, "");
- {
- int _size_1 = a.getSize();
- boolean _greaterThan_1 = (_size_1 > 0);
- if (_greaterThan_1) {
- _builder.append("[]");
- }
- }
- _builder.append(" ");
- String _name_6 = a.getName();
- _builder.append(_name_6, "");
- _builder.append("){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("if(lock_");
- String _name_7 = a.getName();
- _builder.append(_name_7, " ");
- _builder.append(" == null)");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("this.");
- String _name_8 = a.getName();
- _builder.append(_name_8, " ");
- _builder.append(" = ");
- String _name_9 = a.getName();
- _builder.append(_name_9, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("else");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("synchronized(lock_");
- String _name_10 = a.getName();
- _builder.append(_name_10, " ");
- _builder.append("){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("this.");
- String _name_11 = a.getName();
- _builder.append(_name_11, " ");
- _builder.append(" = ");
- String _name_12 = a.getName();
- _builder.append(_name_12, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- _builder.append("public DynConfigLock get");
- String _name_13 = a.getName();
- String _firstUpper_2 = StringExtensions.toFirstUpper(_name_13);
- _builder.append(_firstUpper_2, "");
- _builder.append("Lock(){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("return lock_");
- String _name_14 = a.getName();
- _builder.append(_name_14, " ");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
- _builder.append("}\t");
- _builder.newLine();
}
}
- {
- HashSet<Attribute> _dynConfigAttributes_1 = this.configExt.getDynConfigAttributes(ac, false, true);
- for(final Attribute a_1 : _dynConfigAttributes_1) {
- _builder.append("public void setAndWrite");
- String _name_15 = a_1.getName();
- String _firstUpper_3 = StringExtensions.toFirstUpper(_name_15);
- _builder.append(_firstUpper_3, "");
- _builder.append("(");
- RefableType _refType_2 = a_1.getRefType();
- DataType _type_2 = _refType_2.getType();
- String _typeName_2 = this.typeHelpers.typeName(_type_2);
- _builder.append(_typeName_2, "");
- {
- int _size_2 = a_1.getSize();
- boolean _greaterThan_2 = (_size_2 > 0);
- if (_greaterThan_2) {
- _builder.append("[]");
- }
- }
- _builder.append(" ");
- String _name_16 = a_1.getName();
- _builder.append(_name_16, "");
- _builder.append("){");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("set");
- String _name_17 = a_1.getName();
- String _firstUpper_4 = StringExtensions.toFirstUpper(_name_17);
- _builder.append(_firstUpper_4, " ");
- _builder.append("(");
- String _name_18 = a_1.getName();
- _builder.append(_name_18, " ");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("variableService.write(this.getInstancePath()+\"/");
- String _name_19 = a_1.getName();
- _builder.append(_name_19, " ");
- _builder.append("\", ");
- String _name_20 = a_1.getName();
- _builder.append(_name_20, " ");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("}");
- _builder.newLine();
- }
+ CharSequence result = _builder;
+ int _length = result.length();
+ boolean _notEquals = (_length != 0);
+ if (_notEquals) {
+ StringConcatenation _builder_1 = new StringConcatenation();
+ _builder_1.append("//--------------------- Attribute Specifications");
+ String _plus = (result + _builder_1.toString());
+ result = _plus;
}
- return _builder;
+ return result;
}
- public CharSequence genMinMaxConstants(final ActorClass ac) {
+ private CharSequence genMinMaxConstantsRec(final ActorClass ac, final String varNamePath, final List<Attribute> path) {
CharSequence _xblockexpression = null;
{
- List<AttrClassConfig> _allAttrConfigFlat = this.configExt.getAllAttrConfigFlat(ac);
- final Function1<AttrClassConfig,Boolean> _function = new Function1<AttrClassConfig,Boolean>() {
- public Boolean apply(final AttrClassConfig c) {
- boolean _or = false;
- NumberLiteral _min = c.getMin();
- boolean _notEquals = (!Objects.equal(_min, null));
- if (_notEquals) {
- _or = true;
- } else {
- NumberLiteral _max = c.getMax();
- boolean _notEquals_1 = (!Objects.equal(_max, null));
- _or = (_notEquals || _notEquals_1);
- }
- return Boolean.valueOf(_or);
+ String temp = ((String) null);
+ CharSequence _xifexpression = null;
+ Attribute _last = IterableExtensions.<Attribute>last(path);
+ RefableType _refType = _last.getRefType();
+ DataType _type = _refType.getType();
+ boolean _isDataClass = this.typeHelpers.isDataClass(_type);
+ if (_isDataClass) {
+ StringConcatenation _builder = new StringConcatenation();
+ {
+ Attribute _last_1 = IterableExtensions.<Attribute>last(path);
+ RefableType _refType_1 = _last_1.getRefType();
+ DataType _type_1 = _refType_1.getType();
+ List<Attribute> _allAttributes = this._roomExtensions.getAllAttributes(((DataClass) _type_1));
+ for(final Attribute e : _allAttributes) {
+ String _plus = (varNamePath + "_");
+ String _name = e.getName();
+ String _plus_1 = (_plus + _name);
+ List<Attribute> _union = this._roomExtensions.<Attribute>union(path, e);
+ CharSequence _genMinMaxConstantsRec = this.genMinMaxConstantsRec(ac, _plus_1, _union);
+ _builder.append(_genMinMaxConstantsRec, "");
+ _builder.newLineIfNotEmpty();
}
- };
- Iterable<AttrClassConfig> attrConfigs = IterableExtensions.<AttrClassConfig>filter(_allAttrConfigFlat, _function);
- StringConcatenation _builder = new StringConcatenation();
- {
- boolean _isEmpty = IterableExtensions.isEmpty(attrConfigs);
- boolean _not = (!_isEmpty);
- if (_not) {
- _builder.append("//--------------------- attribute specifications");
- _builder.newLine();
}
- }
- _builder.append("\t");
- _builder.newLine();
- {
- for(final AttrClassConfig c : attrConfigs) {
- Attribute _attribute = c.getAttribute();
- RefableType _refType = _attribute.getRefType();
- DataType _type = _refType.getType();
- PrimitiveType aType = ((PrimitiveType) _type);
- _builder.newLineIfNotEmpty();
+ _xifexpression = _builder;
+ } else {
+ CharSequence _xblockexpression_1 = null;
+ {
+ Attribute _last_2 = IterableExtensions.<Attribute>last(path);
+ RefableType _refType_2 = _last_2.getRefType();
+ DataType _type_2 = _refType_2.getType();
+ PrimitiveType aType = ((PrimitiveType) _type_2);
+ StringConcatenation _builder_1 = new StringConcatenation();
{
- NumberLiteral _min = c.getMin();
- boolean _notEquals = (!Objects.equal(_min, null));
+ String _attrClassConfigMinValue = this.dataConfigExt.getAttrClassConfigMinValue(ac, path);
+ String _temp = temp = _attrClassConfigMinValue;
+ boolean _notEquals = (!Objects.equal(_temp, null));
if (_notEquals) {
- _builder.append("public static ");
+ _builder_1.append("public static ");
String _minMaxType = this.getMinMaxType(aType);
- _builder.append(_minMaxType, "");
- _builder.append(" MIN");
- List<String> _path = this.configExt.getPath(c, false, false, true, true);
- String _path_1 = this.configExt.toPath(_path, "_");
- _builder.append(_path_1, "");
- _builder.append(" = ");
- NumberLiteral _min_1 = c.getMin();
- String _value = this.configExt.getValue(_min_1);
- String _valueLiteral = this.stdExt.toValueLiteral(aType, _value);
- _builder.append(_valueLiteral, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder_1.append(_minMaxType, "");
+ _builder_1.append(" MIN_");
+ _builder_1.append(varNamePath, "");
+ _builder_1.append(" = ");
+ String _valueLiteral = this.stdExt.toValueLiteral(aType, temp);
+ _builder_1.append(_valueLiteral, "");
+ _builder_1.append(";");
+ _builder_1.newLineIfNotEmpty();
}
}
{
- NumberLiteral _max = c.getMax();
- boolean _notEquals_1 = (!Objects.equal(_max, null));
+ String _attrClassConfigMaxValue = this.dataConfigExt.getAttrClassConfigMaxValue(ac, path);
+ String _temp_1 = temp = _attrClassConfigMaxValue;
+ boolean _notEquals_1 = (!Objects.equal(_temp_1, null));
if (_notEquals_1) {
- _builder.append("public static ");
+ _builder_1.append("public static ");
String _minMaxType_1 = this.getMinMaxType(aType);
- _builder.append(_minMaxType_1, "");
- _builder.append(" MAX");
- List<String> _path_2 = this.configExt.getPath(c, false, false, true, true);
- String _path_3 = this.configExt.toPath(_path_2, "_");
- _builder.append(_path_3, "");
- _builder.append(" = ");
- NumberLiteral _max_1 = c.getMax();
- String _value_1 = this.configExt.getValue(_max_1);
- String _valueLiteral_1 = this.stdExt.toValueLiteral(aType, _value_1);
- _builder.append(_valueLiteral_1, "");
- _builder.append(";");
- _builder.newLineIfNotEmpty();
+ _builder_1.append(_minMaxType_1, "");
+ _builder_1.append(" MAX_");
+ _builder_1.append(varNamePath, "");
+ _builder_1.append(" = ");
+ String _valueLiteral_1 = this.stdExt.toValueLiteral(aType, temp);
+ _builder_1.append(_valueLiteral_1, "");
+ _builder_1.append(";");
+ _builder_1.newLineIfNotEmpty();
}
}
+ _xblockexpression_1 = (_builder_1);
}
+ _xifexpression = _xblockexpression_1;
}
- _xblockexpression = (_builder);
+ _xblockexpression = (_xifexpression);
}
return _xblockexpression;
}
private String getMinMaxType(final PrimitiveType type) {
+ String _switchResult = null;
String _typeName = this.typeHelpers.typeName(type);
final String _switchValue = _typeName;
boolean _matched = false;
if (!_matched) {
if (Objects.equal(_switchValue,"byte")) {
_matched=true;
- return "int";
+ _switchResult = "int";
}
}
if (!_matched) {
if (Objects.equal(_switchValue,"short")) {
_matched=true;
- return "int";
+ _switchResult = "int";
}
}
if (!_matched) {
if (Objects.equal(_switchValue,"float")) {
_matched=true;
- return "double";
+ _switchResult = "double";
}
}
- return this.typeHelpers.typeName(type);
+ if (!_matched) {
+ String _typeName_1 = this.typeHelpers.typeName(type);
+ _switchResult = _typeName_1;
+ }
+ return _switchResult;
}
}

Back to the top