public IScope scope_EnumPropertySource_property(final EnumPropertySource exp, final EReference ref) { org.eclipse.vorto.core.api.model.datatype.Enum _model = exp.getModel(); org.eclipse.vorto.core.api.model.datatype.Enum enumType = ((org.eclipse.vorto.core.api.model.datatype.Enum) _model); EList<EnumLiteral> _enums = enumType.getEnums(); return Scopes.scopeFor(_enums); }
@Check public void checkDuplicatedLiteral(final org.eclipse.vorto.core.api.model.datatype.Enum enu) { EList<EnumLiteral> list = enu.getEnums(); HashSet<String> set = new HashSet<String>(); for (int i = 0; (i < ((Object[])Conversions.unwrapArray(list, Object.class)).length); i++) { EnumLiteral _get = list.get(i); String _name = _get.getName(); boolean _add = set.add(_name); boolean _not = (!_add); if (_not) { EnumLiteral _get_1 = list.get(i); this.error(DatatypeSystemMessage.ERROR_DUPLICATED_ENUM_LITERAL, _get_1, DatatypePackage.Literals.ENUM_LITERAL__NAME); } } }
@Override public String getContent(final org.eclipse.vorto.core.api.model.datatype.Enum element, final InvocationContext context) { StringConcatenation _builder = new StringConcatenation(); { EList<EnumLiteral> _enums = element.getEnums(); for(final EnumLiteral literal : _enums) { String _name = literal.getName(); _builder.append(_name, ""); _builder.newLineIfNotEmpty(); } } return _builder.toString(); } }
public String getFirstValueEnum(final FunctionBlock fb, final PropertyType type) { EList<org.eclipse.vorto.core.api.model.datatype.Enum> _referencedEnums = Utils.getReferencedEnums(fb); for (final org.eclipse.vorto.core.api.model.datatype.Enum enum_ : _referencedEnums) { boolean _and = false; String _displayname = enum_.getDisplayname(); Type _type = ((ObjectPropertyType) type).getType(); String _name = _type.getName(); boolean _equals = _displayname.equals(_name); if (!_equals) { _and = false; } else { String _namespace = enum_.getNamespace(); Type _type_1 = ((ObjectPropertyType) type).getType(); String _namespace_1 = _type_1.getNamespace(); boolean _equals_1 = _namespace.equals(_namespace_1); _and = _equals_1; } if (_and) { EList<EnumLiteral> _enums = enum_.getEnums(); EnumLiteral _get = _enums.get(0); return _get.getName(); } } return ""; }
@Override public String getContent(final org.eclipse.vorto.core.api.model.datatype.Enum element, final InvocationContext context) { StringConcatenation _builder = new StringConcatenation(); { EList<EnumLiteral> _enums = element.getEnums(); for(final EnumLiteral literal : _enums) { String _name = literal.getName(); _builder.append(_name, ""); _builder.newLineIfNotEmpty(); } } return _builder.toString(); } }
@Override public String getContent(final org.eclipse.vorto.core.api.model.datatype.Enum en, final InvocationContext invocationContext) { StringConcatenation _builder = new StringConcatenation(); _builder.append("\"type\": \"string\","); _builder.newLine(); _builder.append("\"enum\": [ "); { EList<EnumLiteral> _enums = en.getEnums(); boolean _hasElements = false; for(final EnumLiteral literal : _enums) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate(",", ""); } _builder.append("\""); String _name = literal.getName(); _builder.append(_name, ""); _builder.append("\""); } } _builder.append(" ]"); _builder.newLineIfNotEmpty(); return _builder.toString(); } }
@Override public String getContent(final org.eclipse.vorto.core.api.model.datatype.Enum context, final InvocationContext invocationContext) { StringConcatenation _builder = new StringConcatenation(); _builder.append("//Generated by Vorto"); _builder.newLine(); _builder.newLine(); _builder.append("import Foundation"); _builder.newLine(); _builder.newLine(); _builder.append("enum "); String _name = context.getName(); _builder.append(_name, ""); _builder.append(" {"); _builder.newLineIfNotEmpty(); _builder.newLine(); { EList<EnumLiteral> _enums = context.getEnums(); for(final EnumLiteral literal : _enums) { _builder.append("\t"); _builder.append("case "); String _name_1 = literal.getName(); _builder.append(_name_1, "\t"); _builder.newLineIfNotEmpty(); } } _builder.append("}"); _builder.newLine(); return _builder.toString(); } }
_builder.newLineIfNotEmpty(); EList<EnumLiteral> _enums = en.getEnums(); boolean _hasElements = false; for(final EnumLiteral literal : _enums) {
_builder.newLineIfNotEmpty(); EList<EnumLiteral> _enums = en.getEnums(); boolean _hasElements = false; for(final EnumLiteral literal : _enums) {
_builder.newLine(); EList<EnumLiteral> _enums = en.getEnums(); for(final EnumLiteral literal : _enums) { _builder.append("<tr><td>");
_builder.append("."); Type _returnType_8 = objectType.getReturnType(); EList<EnumLiteral> _enums = ((org.eclipse.vorto.core.api.model.datatype.Enum) _returnType_8).getEnums(); EnumLiteral _get = _enums.get(0); String _name_5 = _get.getName();
_builder.append("."); Type _returnType_8 = objectType.getReturnType(); EList<EnumLiteral> _enums = ((org.eclipse.vorto.core.api.model.datatype.Enum) _returnType_8).getEnums(); EnumLiteral _get = _enums.get(0); String _name_5 = _get.getName();
EList<EnumLiteral> _enums = ((org.eclipse.vorto.core.api.model.datatype.Enum) _type_4).getEnums(); for(final EnumLiteral literal : _enums) { _builder.append("\t");
_builder.append(_name_33, "\t\t"); _builder.append("."); EList<EnumLiteral> _enums = ((org.eclipse.vorto.core.api.model.datatype.Enum) type).getEnums(); EnumLiteral _get = _enums.get(0); String _name_34 = ((EnumLiteral) _get).getName();
_builder.append(_name_33, "\t\t"); _builder.append("."); EList<EnumLiteral> _enums = ((org.eclipse.vorto.core.api.model.datatype.Enum) type).getEnums(); EnumLiteral _get = _enums.get(0); String _name_34 = ((EnumLiteral) _get).getName();