private String getParameterType(final MessageParameter parameter, final String defaultType) { HttpMessageParameterLocation _httpLocation = parameter.getHttpLocation(); if (_httpLocation != null) { switch (_httpLocation) { case HEADER: return "HeaderParameter"; case QUERY: return "QueryParameter"; default: return defaultType; } } else { return defaultType; } }
@Check public void checkMessageParameterType(MessageParameter messageParameter) { if (messageParameter.getContainingMessage() instanceof TypedResponse && messageParameter.getHttpLocation() == HttpMessageParameterLocation.QUERY) { error(NLS.bind(Messages.XtextDslJavaValidator_messageParameterLocation, messageParameter.getHttpLocation().getLiteral().toLowerCase()), messageParameter, RapidmlPackage.Literals.MESSAGE_PARAMETER__HTTP_LOCATION); } }
IterableExtensions.<String>toSet(ListExtensions.<MediaType, String>map(method.getRequest().getMediaTypes(), _function_6)).forEach(_function_7); final Function1<MessageParameter, Boolean> _function_8 = (MessageParameter it) -> { HttpMessageParameterLocation _httpLocation = it.getHttpLocation(); return Boolean.valueOf((!Objects.equal(_httpLocation, HttpMessageParameterLocation.QUERY))); }; IterableExtensions.<MessageParameter>filter(method.getRequest().getParameters(), _function_8).forEach(_function_9); final Function1<MessageParameter, Boolean> _function_10 = (MessageParameter it) -> { HttpMessageParameterLocation _httpLocation = it.getHttpLocation(); return Boolean.valueOf(Objects.equal(_httpLocation, HttpMessageParameterLocation.QUERY)); };
private CharSequence generateRequestParameter(final MessageParameter param, final Method method) { StringConcatenation _builder = new StringConcatenation(); _builder.append("<param id=\""); String _id = method.getId(); String _plus = (_id + "_request_"); String _name = param.getName(); String _plus_1 = (_plus + _name); _builder.append(_plus_1); _builder.append("\" name=\""); String _name_1 = param.getName(); _builder.append(_name_1); _builder.append("\" style=\""); String _parameterLocation = this.parameterLocation(param.getHttpLocation()); _builder.append(_parameterLocation); _builder.append("\" "); CharSequence _generateParameterType = this.generateParameterType(param); _builder.append(_generateParameterType); _builder.append("/>"); _builder.newLineIfNotEmpty(); return _builder; }