@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); } }
public List<Constraint> getMessageParameterConstraints(final MessageParameter parameter) { final SourceReference ref = parameter.getSourceReference(); boolean _matched = false; if (ref instanceof PropertyReference) { _matched=true; final Function1<PropertyRealization, Boolean> _function = (PropertyRealization it) -> { Feature _baseProperty = it.getBaseProperty(); PrimitiveProperty _conceptualFeature = ((PropertyReference)ref).getConceptualFeature(); return Boolean.valueOf(Objects.equal(_baseProperty, _conceptualFeature)); }; PropertyRealization property = IterableExtensions.<PropertyRealization>findFirst(parameter.getContainingMessage().getIncludedProperties(), _function); if ((property == null)) { return ((PropertyReference)ref).getConceptualFeature().getAllConstraints(); } return property.getAllConstraints(); } return null; }
public static ResourceDefinition getContainingResourceDefinition(SourceReference sourceReference) { Parameter containingParameter = sourceReference.getContainingParameter(); if (containingParameter instanceof URIParameter) { return (ResourceDefinition) ((URIParameter) containingParameter).getContainingURI().eContainer(); } if (containingParameter instanceof CollectionParameter) { return ((CollectionParameter) containingParameter).getContainingResourceDefinition(); } if (containingParameter instanceof MessageParameter) { MessageParameter messageParemeter = (MessageParameter) containingParameter; return ((Method) messageParemeter.getContainingMessage().eContainer()).getContainingResourceDefinition(); } // current metamodel doesn't support other kinds of containers return null; }