/** * 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 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 ""; }
private static Set<Type> getTypesOfType(Type type, Set<Type> container) { TreeIterator<EObject> iterator = type.eAllContents(); while (iterator.hasNext()) { EObject current = iterator.next(); if (current instanceof ObjectPropertyType) { if (!container.contains(current)) { container.add(((ObjectPropertyType) current).getType()); Set<Type> moreTypes = getTypesOfType( ((ObjectPropertyType) current).getType(), container); container.addAll(moreTypes); } } } return container; } }
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); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Type getType() { if (type != null && type.eIsProxy()) { InternalEObject oldType = (InternalEObject)type; type = (Type)eResolveProxy(oldType); if (type != oldType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, DatatypePackage.OBJECT_PROPERTY_TYPE__TYPE, oldType, type)); } } return type; }
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); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Type getReturnType() { if (returnType != null && returnType.eIsProxy()) { InternalEObject oldReturnType = (InternalEObject)returnType; returnType = (Type)eResolveProxy(oldReturnType); if (returnType != oldReturnType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, FunctionblockPackage.RETURN_OBJECT_TYPE__RETURN_TYPE, oldReturnType, returnType)); } } return returnType; }
/** * 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; } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Type getType() { if (type != null && type.eIsProxy()) { InternalEObject oldType = (InternalEObject)type; type = (Type)eResolveProxy(oldType); if (type != oldType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, FunctionblockPackage.REF_PARAM__TYPE, oldType, type)); } } return type; }
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; }
String _displayname = enum_.getDisplayname(); Type _type = ((ObjectPropertyType) type).getType(); String _name = _type.getName(); boolean _equals = _displayname.equals(_name); if (!_equals) { String _namespace = enum_.getNamespace(); Type _type_1 = ((ObjectPropertyType) type).getType(); String _namespace_1 = _type_1.getNamespace(); boolean _equals_1 = _namespace.equals(_namespace_1); _and_1 = _equals_1;
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Type getReturnType() { if (returnType != null && returnType.eIsProxy()) { InternalEObject oldReturnType = (InternalEObject)returnType; returnType = (Type)eResolveProxy(oldReturnType); if (returnType != oldReturnType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, FunctionblockPackage.RETURN_OBJECT_TYPE__RETURN_TYPE, oldReturnType, returnType)); } } return returnType; }
return _type_1.getName();
String _displayname = entity.getDisplayname(); Type _type = ((ObjectPropertyType) type).getType(); String _name = _type.getName(); boolean _equals = _displayname.equals(_name); if (!_equals) { String _namespace = entity.getNamespace(); Type _type_1 = ((ObjectPropertyType) type).getType(); String _namespace_1 = _type_1.getNamespace(); boolean _equals_1 = _namespace.equals(_namespace_1); _and_1 = _equals_1;
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Type getType() { if (type != null && type.eIsProxy()) { InternalEObject oldType = (InternalEObject)type; type = (Type)eResolveProxy(oldType); if (type != oldType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, FunctionblockPackage.REF_PARAM__TYPE, oldType, type)); } } return type; }
return _type_1.getName();
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); } } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Type getType() { if (type != null && type.eIsProxy()) { InternalEObject oldType = (InternalEObject)type; type = (Type)eResolveProxy(oldType); if (type != oldType) { if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.RESOLVE, DatatypePackage.OBJECT_PROPERTY_TYPE__TYPE, oldType, type)); } } return type; }
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(); } } }