类org.springframework.web.servlet.mvc.condition.NameValueExpression源码实例Demo

下面列出了怎么用org.springframework.web.servlet.mvc.condition.NameValueExpression的API类实例代码及写法,或者点击链接到github查看源代码。

/**
 * 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;
}
 
/**
 * 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;
}
 
源代码3 项目: lams   文件: RequestMappingInfoHandlerMapping.java
/**
 * 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;
}
 
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;
}
 
源代码5 项目: swagger-more   文件: ApiRequestHandler.java
@Override
public Set<NameValueExpression<String>> headers() {
    return Sets.newHashSet();
}
 
源代码6 项目: swagger-more   文件: ApiRequestHandler.java
@Override
public Set<NameValueExpression<String>> params() {
    return Sets.newHashSet();
}
 
 类方法
 同包方法