本文整理汇总了Java中org.springframework.web.servlet.mvc.condition.NameValueExpression类的典型用法代码示例。如果您正苦于以下问题:Java NameValueExpression类的具体用法?Java NameValueExpression怎么用?Java NameValueExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NameValueExpression类属于org.springframework.web.servlet.mvc.condition包,在下文中一共展示了NameValueExpression类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: of
import org.springframework.web.servlet.mvc.condition.NameValueExpression; //导入依赖的package包/类
public static List<OriginalRequestMappingInfo> of(RequestMappingHandlerMapping handlerMapping) {
List<OriginalRequestMappingInfo> result = new ArrayList<OriginalRequestMappingInfo>();
for (Entry<RequestMappingInfo, HandlerMethod> entry : handlerMapping.getHandlerMethods().entrySet()) {
RequestMappingInfo requestMappingInfo = entry.getKey();
OriginalRequestMappingInfo o = new OriginalRequestMappingInfo();
o.setSite(Site.of(requestMappingInfo.getPatternsCondition().getPatterns().iterator().next()));
o.setMethods(requestMappingInfo.getMethodsCondition().getMethods());
o.setPatterns(requestMappingInfo.getPatternsCondition().getPatterns());
Set<String> params = new HashSet<>();
for (NameValueExpression<String> nameValueExpression : requestMappingInfo.getParamsCondition().getExpressions()) {
params.add(nameValueExpression.toString());
}
o.setParams(params);
result.add(o);
}
return result.stream().sorted().collect(Collectors.toList());
}
开发者ID:sinsengumi,项目名称:spring-boot-application-infrastructure,代码行数:23,代码来源:RouterController.java
示例2: getRequestParams
import org.springframework.web.servlet.mvc.condition.NameValueExpression; //导入依赖的package包/类
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;
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:17,代码来源:RequestMappingInfoHandlerMapping.java
示例3: setFrom
import org.springframework.web.servlet.mvc.condition.NameValueExpression; //导入依赖的package包/类
private void setFrom(RequestMappingInfo info, Permission permission) {
permission.setUrl(API_PREFIX
+ info.getPatternsCondition().getPatterns().stream().collect(Collectors.joining(", ")));
permission.setHttpMethod(info.getMethodsCondition().getMethods().stream()
.map(Enum::toString).collect(Collectors.joining(", ")));
Set<NameValueExpression<String>> params = info.getParamsCondition().getExpressions();
if (!params.isEmpty()) {
permission.setParameters("Url parameters: " + params.stream()
.map(NameValueExpression::getName)
.collect(Collectors.joining(", "))
);
}
}
开发者ID:imCodePartnerAB,项目名称:iVIS,代码行数:14,代码来源:PermissionRestController.java
示例4: getRequestParams
import org.springframework.web.servlet.mvc.condition.NameValueExpression; //导入依赖的package包/类
private Set<String> getRequestParams(HttpServletRequest request, Set<RequestMappingInfo> partialMatches) {
for (RequestMappingInfo partialMatch : partialMatches) {
ParamsRequestCondition condition = partialMatch.getParamsCondition();
if (!CollectionUtils.isEmpty(condition.getExpressions()) && (condition.getMatchingCondition(request) == null)) {
Set<String> expressions = new HashSet<String>();
for (NameValueExpression<String> expr : condition.getExpressions()) {
expressions.add(expr.toString());
}
return expressions;
}
}
return null;
}
开发者ID:deathspeeder,项目名称:class-guard,代码行数:14,代码来源:RequestMappingInfoHandlerMapping.java
示例5: getExpressions
import org.springframework.web.servlet.mvc.condition.NameValueExpression; //导入依赖的package包/类
/**
* Return the contained request header expressions.
*/
public Set<NameValueExpression<String>> getExpressions() {
return new LinkedHashSet<NameValueExpression<String>>(this.expressions);
}
开发者ID:tanhaichao,项目名称:leopard,代码行数:7,代码来源:ServerNameRequestCondition.java
注:本文中的org.springframework.web.servlet.mvc.condition.NameValueExpression类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论