org.springframework.web.servlet.mvc.condition.NameValueExpression Java Examples

The following examples show how to use org.springframework.web.servlet.mvc.condition.NameValueExpression. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RequestMappingInfoHandlerMapping.java    From spring-analysis-note with MIT License 6 votes vote down vote up
/**
 * Return declared "params" conditions but only among those that also
 * match the "methods", "consumes", and "params" conditions.
 */
public List<String[]> getParamConditions() {
	List<String[]> result = new ArrayList<>();
	for (PartialMatch match : this.partialMatches) {
		if (match.hasProducesMatch()) {
			Set<NameValueExpression<String>> set = match.getInfo().getParamsCondition().getExpressions();
			if (!CollectionUtils.isEmpty(set)) {
				int i = 0;
				String[] array = new String[set.size()];
				for (NameValueExpression<String> expression : set) {
					array[i++] = expression.toString();
				}
				result.add(array);
			}
		}
	}
	return result;
}
 
Example #2
Source File: RequestMappingInfoHandlerMapping.java    From java-technology-stack with MIT License 6 votes vote down vote up
/**
 * Return declared "params" conditions but only among those that also
 * match the "methods", "consumes", and "params" conditions.
 */
public List<String[]> getParamConditions() {
	List<String[]> result = new ArrayList<>();
	for (PartialMatch match : this.partialMatches) {
		if (match.hasProducesMatch()) {
			Set<NameValueExpression<String>> set = match.getInfo().getParamsCondition().getExpressions();
			if (!CollectionUtils.isEmpty(set)) {
				int i = 0;
				String[] array = new String[set.size()];
				for (NameValueExpression<String> expression : set) {
					array[i++] = expression.toString();
				}
				result.add(array);
			}
		}
	}
	return result;
}
 
Example #3
Source File: RequestMappingInfoHandlerMapping.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return declared "params" conditions but only among those that also
 * match the "methods", "consumes", and "params" conditions.
 */
public List<String[]> getParamConditions() {
	List<String[]> result = new ArrayList<String[]>();
	for (PartialMatch match : this.partialMatches) {
		if (match.hasProducesMatch()) {
			Set<NameValueExpression<String>> set = match.getInfo().getParamsCondition().getExpressions();
			if (!CollectionUtils.isEmpty(set)) {
				int i = 0;
				String[] array = new String[set.size()];
				for (NameValueExpression<String> expression : set) {
					array[i++] = expression.toString();
				}
				result.add(array);
			}
		}
	}
	return result;
}
 
Example #4
Source File: RequestMappingInfoHandlerMapping.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
private List<String[]> getRequestParams(HttpServletRequest request, Set<RequestMappingInfo> partialMatches) {
	List<String[]> result = new ArrayList<String[]>();
	for (RequestMappingInfo partialMatch : partialMatches) {
		ParamsRequestCondition condition = partialMatch.getParamsCondition();
		Set<NameValueExpression<String>> expressions = condition.getExpressions();
		if (!CollectionUtils.isEmpty(expressions) && condition.getMatchingCondition(request) == null) {
			int i = 0;
			String[] array = new String[expressions.size()];
			for (NameValueExpression<String> expression : expressions) {
				array[i++] = expression.toString();
			}
			result.add(array);
		}
	}
	return result;
}
 
Example #5
Source File: ApiRequestHandler.java    From swagger-more with Apache License 2.0 4 votes vote down vote up
@Override
public Set<NameValueExpression<String>> headers() {
    return Sets.newHashSet();
}
 
Example #6
Source File: ApiRequestHandler.java    From swagger-more with Apache License 2.0 4 votes vote down vote up
@Override
public Set<NameValueExpression<String>> params() {
    return Sets.newHashSet();
}