Search in sources :

Example 41 with Parameter

use of org.apache.tapestry5.annotations.Parameter in project tapestry-5 by apache.

the class DefaultOpenApiDescriptionGenerator method getParameterName.

private String getParameterName(Parameter parameter) {
    String name = null;
    final RequestParameter requestParameter = parameter.getAnnotation(RequestParameter.class);
    if (requestParameter != null && !CommonsUtils.isBlank(requestParameter.value())) {
        name = requestParameter.value();
    }
    ActivationContextParameter activationContextParameter = parameter.getAnnotation(ActivationContextParameter.class);
    if (activationContextParameter != null && !CommonsUtils.isBlank(activationContextParameter.value())) {
        name = activationContextParameter.value();
    }
    if (CommonsUtils.isBlank(name)) {
        name = parameter.getName();
    }
    return name;
}
Also used : ActivationContextParameter(org.apache.tapestry5.annotations.ActivationContextParameter) RequestParameter(org.apache.tapestry5.annotations.RequestParameter)

Aggregations

TapestryException (org.apache.tapestry5.commons.internal.util.TapestryException)12 UnknownValueException (org.apache.tapestry5.commons.util.UnknownValueException)6 MutableComponentModel (org.apache.tapestry5.model.MutableComponentModel)6 RequestParameter (org.apache.tapestry5.annotations.RequestParameter)5 JSONObject (org.apache.tapestry5.json.JSONObject)5 ComponentEvent (org.apache.tapestry5.runtime.ComponentEvent)5 InternalComponentResources (org.apache.tapestry5.internal.InternalComponentResources)4 Test (org.testng.annotations.Test)4 Binding (org.apache.tapestry5.Binding)3 ComponentResources (org.apache.tapestry5.ComponentResources)3 ActivationContextParameter (org.apache.tapestry5.annotations.ActivationContextParameter)3 Location (org.apache.tapestry5.commons.Location)3 Resource (org.apache.tapestry5.commons.Resource)3 AvailableValues (org.apache.tapestry5.commons.util.AvailableValues)3 LiteralBinding (org.apache.tapestry5.internal.bindings.LiteralBinding)3 Logger (org.slf4j.Logger)3 Method (java.lang.reflect.Method)2 Parameter (java.lang.reflect.Parameter)2 EventContext (org.apache.tapestry5.EventContext)2 ValueEncoder (org.apache.tapestry5.ValueEncoder)2