/** * Returns the name of the return type or 'returnValue' as string */ public static String getReturnNameAsString(final ReturnType returnType) { if ((returnType instanceof ReturnObjectType)) { Type _returnType = ((ReturnObjectType) returnType).getReturnType(); String _name = _returnType.getName(); return StringExtensions.toFirstLower(_name); } else { if ((returnType instanceof ReturnPrimitiveType)) { return "returnValue"; } } return null; }
private static void createReference(Entity entity, ObjectPropertyType type) { ModelReference reference = ModelFactory.eINSTANCE.createModelReference(); reference.setImportedNamespace(type.getType().getNamespace() + "." + type.getType().getName()); reference.setVersion(type.getType().getVersion()); entity.getReferences().add(reference); }
/** * Returns the name of the return type or 'returnValue' as string */ public static String getReturnNameAsString(final ReturnType returnType) { if ((returnType instanceof ReturnObjectType)) { Type _returnType = ((ReturnObjectType) returnType).getReturnType(); String _name = _returnType.getName(); return StringExtensions.toFirstLower(_name); } else { if ((returnType instanceof ReturnPrimitiveType)) { return "returnValue"; } } return null; }
public EList<Property> getEntity(final FunctionBlock fb, final PropertyType type) { EList<Entity> _referencedEntities = Utils.getReferencedEntities(fb); for (final Entity entity : _referencedEntities) { boolean _and = false; String _displayname = entity.getDisplayname(); Type _type = ((ObjectPropertyType) type).getType(); String _name = _type.getName(); boolean _equals = _displayname.equals(_name); if (!_equals) { _and = false; } else { String _namespace = entity.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) { return entity.getProperties(); } } return null; } }
public static String getReturnType(final ReturnType type) { if ((type instanceof ReturnPrimitiveType)) { PrimitiveType _returnType = ((ReturnPrimitiveType) type).getReturnType(); return _returnType.getName(); } else { if ((type instanceof ReturnObjectType)) { Type _returnType_1 = ((ReturnObjectType) type).getReturnType(); return _returnType_1.getName(); } } return null; }
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 ""; }
return _type_1.getName();
private static void createReference(FunctionblockModel fbm, ObjectPropertyType type) { ModelReference reference = ModelFactory.eINSTANCE.createModelReference(); reference.setImportedNamespace(type.getType().getNamespace() + "." + type.getType().getName()); reference.setVersion(type.getType().getVersion()); fbm.getReferences().add(reference); }
return _type_1.getName();
String _displayname = enum_.getDisplayname(); Type _type = ((ObjectPropertyType) type).getType(); String _name = _type.getName(); boolean _equals = _displayname.equals(_name); if (!_equals) {
public String getType(final PropertyType propType) { if ((propType instanceof PrimitivePropertyType)) { PrimitivePropertyType primitiveProp = ((PrimitivePropertyType) propType); PrimitiveType _type = primitiveProp.getType(); if (_type != null) { switch (_type) { case STRING: return "String"; case INT: return "Int"; case DATETIME: return "NSDate"; case DOUBLE: return "Double"; case FLOAT: return "Float"; default: return "String"; } } else { return "String"; } } else { Type _type_1 = ((ObjectPropertyType) propType).getType(); return _type_1.getName(); } } }
String _displayname = entity.getDisplayname(); Type _type = ((ObjectPropertyType) type).getType(); String _name = _type.getName(); boolean _equals = _displayname.equals(_name); if (!_equals) {
/** * Returns the return type as string */ public static String getReturnTypeAsString(final Operation op) { ReturnType _returnType = op.getReturnType(); boolean _notEquals = (!Objects.equal(_returnType, null)); if (_notEquals) { ReturnType returnType = op.getReturnType(); if ((returnType instanceof ReturnObjectType)) { Type _returnType_1 = ((ReturnObjectType) returnType).getReturnType(); return _returnType_1.getName(); } else { if ((returnType instanceof ReturnPrimitiveType)) { PrimitiveType _returnType_2 = ((ReturnPrimitiveType) returnType).getReturnType(); return _returnType_2.getName(); } } } else { return "void"; } return null; }
public String type(final PropertyType type) { if ((type instanceof PrimitivePropertyType)) { PrimitiveType _type = ((PrimitivePropertyType) type).getType(); return this.toCppPrimitive(_type); } else { if ((type instanceof DictionaryPropertyType)) { PropertyType _keyType = ((DictionaryPropertyType) type).getKeyType(); String _type_1 = this.type(_keyType); String _plus = ("map<" + _type_1); String _plus_1 = (_plus + ","); PropertyType _valueType = ((DictionaryPropertyType) type).getValueType(); String _type_2 = this.type(_valueType); String _plus_2 = (_plus_1 + _type_2); return (_plus_2 + ">"); } else { Type _type_3 = ((ObjectPropertyType) type).getType(); String _namespace = _type_3.getNamespace(); String _replace = _namespace.replace(".", "_"); String _plus_3 = (_replace + "::"); Type _type_4 = ((ObjectPropertyType) type).getType(); String _name = _type_4.getName(); return (_plus_3 + _name); } } }
/** * Returns the return type as string */ public static String getReturnTypeAsString(final Operation op) { ReturnType _returnType = op.getReturnType(); boolean _notEquals = (!Objects.equal(_returnType, null)); if (_notEquals) { ReturnType returnType = op.getReturnType(); if ((returnType instanceof ReturnObjectType)) { Type _returnType_1 = ((ReturnObjectType) returnType).getReturnType(); return _returnType_1.getName(); } else { if ((returnType instanceof ReturnPrimitiveType)) { PrimitiveType _returnType_2 = ((ReturnPrimitiveType) returnType).getReturnType(); return _returnType_2.getName(); } } } else { return "void"; } return null; }
public static String getPropertyType(final Property property) { PropertyType _type = property.getType(); if ((_type instanceof PrimitivePropertyType)) { PropertyType _type_1 = property.getType(); PrimitiveType _type_2 = ((PrimitivePropertyType) _type_1).getType(); return _type_2.getName(); } else { PropertyType _type_3 = property.getType(); if ((_type_3 instanceof ObjectPropertyType)) { PropertyType _type_4 = property.getType(); Type _type_5 = ((ObjectPropertyType) _type_4).getType(); return _type_5.getName(); } } return null; }
_builder.append("public "); Type _returnType_2 = objectType.getReturnType(); String _name = _returnType_2.getName(); _builder.append(_name, ""); _builder.append(" "); _builder.append("\t"); Type _returnType_4 = objectType.getReturnType(); String _name_2 = _returnType_4.getName(); _builder.append(_name_2, "\t"); _builder.append(" result = new "); Type _returnType_5 = objectType.getReturnType(); String _name_3 = _returnType_5.getName(); _builder.append(_name_3, "\t"); _builder.append("();"); _builder.append("return "); Type _returnType_7 = objectType.getReturnType(); String _name_4 = _returnType_7.getName(); _builder.append(_name_4, "\t"); _builder.append(".");
_builder.append("public "); Type _returnType_2 = objectType.getReturnType(); String _name = _returnType_2.getName(); _builder.append(_name, ""); _builder.append(" "); _builder.append("\t"); Type _returnType_4 = objectType.getReturnType(); String _name_2 = _returnType_4.getName(); _builder.append(_name_2, "\t"); _builder.append(" result = new "); Type _returnType_5 = objectType.getReturnType(); String _name_3 = _returnType_5.getName(); _builder.append(_name_3, "\t"); _builder.append("();"); _builder.append("return "); Type _returnType_7 = objectType.getReturnType(); String _name_4 = _returnType_7.getName(); _builder.append(_name_4, "\t"); _builder.append(".");
_builder.append("public "); Type _returnType_2 = objectType.getReturnType(); String _name_5 = _returnType_2.getName(); _builder.append(_name_5, "\t"); _builder.append(" ");
_builder.append("public "); Type _returnType_2 = objectType.getReturnType(); String _name_8 = _returnType_2.getName(); _builder.append(_name_8, "\t"); _builder.append(" ");