本文整理了Java中org.eclipse.vorto.core.api.model.datatype.Enum.getEnums()
方法的一些代码示例,展示了Enum.getEnums()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Enum.getEnums()
方法的具体详情如下:
包路径:org.eclipse.vorto.core.api.model.datatype.Enum
类名称:Enum
方法名:getEnums
[英]Returns the value of the 'Enums' containment reference list. The list contents are of type org.eclipse.vorto.core.api.model.datatype.EnumLiteral.
If the meaning of the 'Enums' containment reference list isn't clear, there really should be more of a description here...
[中]
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.editor.mapping
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);
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.editor.datatype
@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);
}
}
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.aws
@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();
}
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.arduino
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 "";
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.examples.aws
@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();
}
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.ditto
@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();
}
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.arduino
_builder.newLineIfNotEmpty();
EList<EnumLiteral> _enums = dataEnum.getEnums();
for(final EnumLiteral entries : _enums) {
EList<EnumLiteral> _enums_1 = dataEnum.getEnums();
EnumLiteral _last = IterableExtensions.<EnumLiteral>last(_enums_1);
boolean _equals = _last.equals(entries);
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.examples.ios
@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();
}
}
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.templates.java
_builder.newLineIfNotEmpty();
EList<EnumLiteral> _enums = en.getEnums();
boolean _hasElements = false;
for(final EnumLiteral literal : _enums) {
代码示例来源:origin: org.eclipse.vorto/generator-templates-java
_builder.newLineIfNotEmpty();
EList<EnumLiteral> _enums = en.getEnums();
boolean _hasElements = false;
for(final EnumLiteral literal : _enums) {
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.latex
_builder.newLine();
EList<EnumLiteral> _enums = en.getEnums();
for(final EnumLiteral literal : _enums) {
_builder.append("<tr><td>");
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.templates.java
_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();
代码示例来源:origin: org.eclipse.vorto/generator-templates-java
_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();
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.latex
EList<EnumLiteral> _enums = ((org.eclipse.vorto.core.api.model.datatype.Enum) _type_4).getEnums();
for(final EnumLiteral literal : _enums) {
_builder.append("\t");
代码示例来源:origin: org.eclipse.vorto/org.eclipse.vorto.codegen.examples.prosystfi
_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();
代码示例来源:origin: org.eclipse.vorto/boschiotsuite-gateway
_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();
内容来源于网络,如有侵权,请联系作者删除!