final String operName = operation.getName(); String operDescr = operation.getDescription(); final EList<Param> params = operation.getParams(); if( !params.isEmpty() ) { final String errMsg = "Unsupported operation <" + operName throw new IllegalArgumentException( errMsg ); final ReturnType returnType = operation.getReturnType(); if( returnType != null ) { final String errMsg = "Unsupported operation <" + operName
private void generateForOperation(Operation op, IGeneratedWriter outputter) { if(op.getReturnType() != null && op.getReturnType() instanceof ReturnPrimitiveType){ primTypeWrapperRequired = true; new JavaFBOperationReturnPrimitiveTypeWrapperGeneratorTask( op.getName() + COAP_PRIM_TYPE_WRAPPER_SUFFIX, JAVA_FILE_EXTENSION, primitiveTypeWrapperTargetPath, PRIMITIVE_TYPE_WRAPPER_PACKAGE).generate(op, null, outputter); } if(!op.getParams().isEmpty()){ opParamSetRequired = true; new JavaFBOperationParamSetGeneratorTask( op.getName() + COAP_PARAM_SET_SUFFIX, JAVA_FILE_EXTENSION, opParameterSetTargetPath, OP_PARAM_SET_PACKAGE, DT_PACKAGE).generate(op, null, outputter); } }
String _name = currentService.getName(); g.writeStringField("name", _name); String _description = this.getDescription(currentService); String _resultBaseType = this.getResultBaseType(currentService); g.writeStringField("baseType", _resultBaseType); String _description_1 = currentService.getDescription(); g.writeStringField("description", _description_1); g.writeEndObject(); g.writeArrayFieldStart("parameterDefinitions"); EList<Param> _params = currentService.getParams(); for (final Param currentParam : _params) { if ((currentParam instanceof PrimitiveParam)) {
_builder.newLine(); _builder.append("\t"); String _name = operation.getName(); String _replace = _name.replace("_", "\\_"); _builder.append(_replace, "\t"); _builder.append(" & "); ReturnType _returnType = operation.getReturnType(); String _returnType_1 = Utils.getReturnType(_returnType); _builder.append(_returnType_1, "\t"); _builder.append(" & "); String _description = operation.getDescription(); _builder.append(_description, "\t"); _builder.append("\\\\");
protected CharSequence getDefaultCommand(final String fbPropertyName, final Operation operation) { CharSequence _xifexpression = null; boolean _and = false; EList<Param> _params = operation.getParams(); boolean _notEquals = (!Objects.equal(_params, null)); if (!_notEquals) { _and = false; } else { EList<Param> _params_1 = operation.getParams(); int _length = ((Object[])Conversions.unwrapArray(_params_1, Object.class)).length; boolean _greaterThan = (_length > 0); StringConcatenation _builder = new StringConcatenation(); EList<Param> _params_2 = operation.getParams(); boolean _hasElements = false; for(final Param param : _params_2) { String _name_1 = operation.getName(); return ((fbPropertyName + " ") + _name_1);
@Override public String getFileName(final Operation context) { String _name = context.getName(); String _plus = ("UpdateThingShadowLambda_" + _name); return (_plus + ".js"); }
String _xblockexpression = null; EObject _eContainer = operation.eContainer(); EObject _eContainer_1 = _eContainer.eContainer(); FunctionblockModel fbm = ((FunctionblockModel) _eContainer_1); _builder.append(definition, "\t"); _builder.append("> for message subject (operation name) <"); String _name_1 = operation.getName(); _builder.append(_name_1, "\t"); _builder.append(">\","); _builder.append("\t"); _builder.append("\"description\": \""); String _description = operation.getDescription(); _builder.append(_description, "\t"); _builder.append("\""); ReturnType _returnType = operation.getReturnType(); boolean _tripleNotEquals = (_returnType != null); if (_tripleNotEquals) { ReturnType _returnType_1 = operation.getReturnType(); boolean _tripleNotEquals_1 = (_returnType_1 != null); if (_tripleNotEquals_1) { _builder.append("\t"); final ReturnType returnType = operation.getReturnType(); _builder.newLineIfNotEmpty();
ReturnType _returnType = operation.getReturnType(); boolean _notEquals_1 = (!Objects.equal(_returnType, null)); if (!_notEquals_1) { _and = false; } else { ReturnType _returnType_1 = operation.getReturnType(); _and = (_returnType_1 instanceof ReturnObjectType); _builder.append(" "); _builder.append("class func "); String _name_13 = operation.getName(); _builder.append(_name_13, " "); _builder.append("(value : NSData) -> "); ReturnType _returnType_2 = operation.getReturnType(); Type _returnType_3 = ((ReturnObjectType) _returnType_2).getReturnType(); String _name_14 = _returnType_3.getName(); _builder.append("\t"); _builder.append("var result = "); ReturnType _returnType_4 = operation.getReturnType(); Type _returnType_5 = ((ReturnObjectType) _returnType_4).getReturnType(); String _name_15 = _returnType_5.getName(); ReturnType _returnType_6 = operation.getReturnType(); boolean _notEquals_2 = (!Objects.equal(_returnType_6, null)); if (!_notEquals_2) { _and_1 = false; } else { ReturnType _returnType_7 = operation.getReturnType();
EObject _eContainer = operation.eContainer(); EObject _eContainer_1 = _eContainer.eContainer(); FunctionblockModel fbm = ((FunctionblockModel) _eContainer_1); _builder.append(definition, "\t"); _builder.append("> for message subject (operation name) <"); String _name_1 = operation.getName(); _builder.append(_name_1, "\t"); _builder.append(">\","); String _description = operation.getDescription(); boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(_description); boolean _not = (!_isNullOrEmpty); if (_not) { _builder.append("\"description\": \""); String _description_1 = operation.getDescription(); _builder.append(_description_1, "\t"); _builder.append("\""); EList<Param> _params = operation.getParams(); boolean _isEmpty = _params.isEmpty(); boolean _not_1 = (!_isEmpty); EList<Param> _params_1 = operation.getParams(); int _size = _params_1.size(); boolean _tripleEquals = (_size == 1); if (_tripleEquals) { _builder.append("\t"); EList<Param> _params_2 = operation.getParams();
_builder.append("\t"); _builder.append(".add(new Resource(\""); String _name_3 = operation.getName(); String _firstLower_2 = StringExtensions.toFirstLower(_name_3); _builder.append(_firstLower_2, "\t\t\t"); _builder.append("\t\t"); _builder.append("getAttributes().addAttribute(\"title\", \""); String _description_2 = operation.getDescription(); _builder.append(_description_2, "\t\t\t\t\t"); _builder.append(" \");");
private String operationParams(final Operation op) { String result = ""; boolean _and = false; EList<Param> _params = op.getParams(); boolean _notEquals = (!Objects.equal(_params, null)); if (!_notEquals) { _and = false; } else { EList<Param> _params_1 = op.getParams(); int _size = _params_1.size(); boolean _greaterThan = (_size > 0); EList<Param> _params_2 = op.getParams(); for (final Param param : _params_2) { String _result = result;
protected String getResultBaseType(final Operation operation) { boolean _and = false; ReturnType _returnType = operation.getReturnType(); boolean _notEquals = (!Objects.equal(_returnType, null)); if (!_notEquals) { _and = false; } else { ReturnType _returnType_1 = operation.getReturnType(); _and = (_returnType_1 instanceof ReturnPrimitiveType); } if (_and) { ReturnType _returnType_2 = operation.getReturnType(); boolean _isMultiplicity = _returnType_2.isMultiplicity(); boolean _equals = (_isMultiplicity == false); if (_equals) { ReturnType primitiveType = operation.getReturnType(); PrimitiveType _returnType_3 = ((ReturnPrimitiveType) primitiveType).getReturnType(); String typeName = _returnType_3.getLiteral(); return this.getThingWorxDataType(typeName); } else { return "COMPLEX_TYPE"; } } else { return "NOTHING"; } }
for (final Operation op : _operations) { ReturnType _returnType = op.getReturnType(); if ((_returnType instanceof ReturnObjectType)) { ReturnType _returnType_1 = op.getReturnType(); Type _returnType_2 = ((ReturnObjectType) _returnType_1).getReturnType(); EList<Type> _referencedTypes_3 = Utils.getReferencedTypes(_returnType_2); types.addAll(_referencedTypes_3); EList<Param> _params = op.getParams(); for (final Param param : _params) { if ((param instanceof RefParam)) {
protected String getDescription(final Operation operation) { String _description = operation.getDescription(); boolean _notEquals = (!Objects.equal(_description, null)); if (_notEquals) { return operation.getDescription(); } else { return ""; } }
_builder.newLine(); _builder.append("* "); String _description = op.getDescription(); _builder.append(_description, ""); _builder.newLineIfNotEmpty(); ReturnType _returnType = op.getReturnType(); if ((_returnType instanceof ReturnObjectType)) { ReturnType _returnType_1 = op.getReturnType(); ReturnObjectType objectType = ((ReturnObjectType) _returnType_1); _builder.newLineIfNotEmpty(); _builder.append(_name, ""); _builder.append(" "); String _name_1 = op.getName(); _builder.append(_name_1, ""); _builder.append("("); _builder.newLine(); } else { ReturnType _returnType_9 = op.getReturnType(); if ((_returnType_9 instanceof ReturnPrimitiveType)) { ReturnType _returnType_10 = op.getReturnType(); ReturnPrimitiveType primitiveType = ((ReturnPrimitiveType) _returnType_10); _builder.newLineIfNotEmpty(); _builder.append(_name_6, ""); _builder.append(" "); String _name_7 = op.getName();
protected CharSequence getDefaultCommand(final Operation operation) { CharSequence _xifexpression = null; boolean _and = false; EList<Param> _params = operation.getParams(); boolean _notEquals = (!Objects.equal(_params, null)); if (!_notEquals) { _and = false; } else { EList<Param> _params_1 = operation.getParams(); int _length = ((Object[])Conversions.unwrapArray(_params_1, Object.class)).length; boolean _greaterThan = (_length > 0); StringConcatenation _builder = new StringConcatenation(); EList<Param> _params_2 = operation.getParams(); boolean _hasElements = false; for(final Param param : _params_2) { return operation.getName();
private void generateForOperation(Operation op, IGeneratedWriter outputter) { if(op.getReturnType() != null && op.getReturnType() instanceof ReturnPrimitiveType){ primTypeWrapperRequired = true; new JavaFBOperationReturnPrimitiveTypeWrapperGeneratorTask( op.getName() + COAP_PRIM_TYPE_WRAPPER_SUFFIX, JAVA_FILE_EXTENSION, primitiveTypeWrapperTargetPath, PRIMITIVE_TYPE_WRAPPER_PACKAGE).generate(op, null, outputter); } if(!op.getParams().isEmpty()){ opParamSetRequired = true; new JavaFBOperationParamSetGeneratorTask( op.getName() + COAP_PARAM_SET_SUFFIX, JAVA_FILE_EXTENSION, opParameterSetTargetPath, OP_PARAM_SET_PACKAGE, DT_PACKAGE).generate(op, null, outputter); } }
@Override public String getFileName(Operation operation) { return operation.getName() + filename; } }
for(final Operation operation : _operations) { ReturnType _returnType = operation.getReturnType(); boolean _notEquals = (!Objects.equal(_returnType, null)); if (_notEquals) { _builder.append(_name_11, " \t"); _builder.append("Device."); String _name_12 = operation.getName(); _builder.append(_name_12, " \t"); _builder.append("(characteristics.value)");
_builder.append("\t"); _builder.append(".add(new Resource(\""); String _name_3 = operation.getName(); String _firstLower_2 = StringExtensions.toFirstLower(_name_3); _builder.append(_firstLower_2, "\t\t\t"); _builder.append("\t\t"); _builder.append("getAttributes().addAttribute(\"title\", \""); String _description_2 = operation.getDescription(); _builder.append(_description_2, "\t\t\t\t\t"); _builder.append(" \");");