List of usage examples for org.springframework.web.servlet.mvc.condition NameValueExpression getValue
@Nullable T getValue();
From source file:springfox.documentation.spring.web.readers.operation.AbstractOperationParameterRequestConditionReader.java
public List<Parameter> getParameters(Set<NameValueExpression<String>> expressions, String parameterType) { List<Parameter> parameters = newArrayList(); for (NameValueExpression<String> expression : expressions) { if (skipParameter(parameters, expression)) { continue; }/*from w ww . ja va 2 s. co m*/ String paramValue = expression.getValue(); AllowableListValues allowableValues = null; if (!isNullOrEmpty(paramValue)) { allowableValues = new AllowableListValues(newArrayList(paramValue), "string"); } Parameter parameter = new ParameterBuilder().name(expression.getName()).description(null) .defaultValue(paramValue).required(true).allowMultiple(false) .type(resolver.resolve(String.class)).modelRef(new ModelRef("string")) .allowableValues(allowableValues).parameterType(parameterType).build(); parameters.add(parameter); } return parameters; }
From source file:springfox.documentation.spring.web.readers.operation.OperationParameterRequestConditionReader.java
@Override public void apply(OperationContext context) { ParamsRequestCondition paramsCondition = context.getRequestMappingInfo().getParamsCondition(); List<Parameter> parameters = newArrayList(); for (NameValueExpression<String> expression : paramsCondition.getExpressions()) { if (skipParameter(parameters, expression)) { continue; }/* www .j a va 2 s.c o m*/ String paramValue = expression.getValue(); AllowableListValues allowableValues = null; if (!isNullOrEmpty(paramValue)) { allowableValues = new AllowableListValues(newArrayList(paramValue), "string"); } Parameter parameter = new ParameterBuilder().name(expression.getName()).description(null) .defaultValue(paramValue).required(true).allowMultiple(false) .type(resolver.resolve(String.class)).modelRef(new ModelRef("string")) .allowableValues(allowableValues).parameterType("query").build(); parameters.add(parameter); } context.operationBuilder().parameters(parameters); }