本文整理汇总了Java中org.apache.commons.collections.CollectionUtils.EMPTY_COLLECTION属性的典型用法代码示例。如果您正苦于以下问题:Java CollectionUtils.EMPTY_COLLECTION属性的具体用法?Java CollectionUtils.EMPTY_COLLECTION怎么用?Java CollectionUtils.EMPTY_COLLECTION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.commons.collections.CollectionUtils
的用法示例。
在下文中一共展示了CollectionUtils.EMPTY_COLLECTION属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAttributes
@SuppressWarnings("unchecked")
public Collection<ConfigAttribute> getAttributes(Object object) throws IllegalArgumentException {
String url=null;
if(object instanceof FilterInvocation){
HttpServletRequest request=((FilterInvocation)object).getRequest();
url=this.getRequestPath(request);
}else{
url=(String)object;
}
Collection<ConfigAttribute> safeUrlAttributes=this.getAnonymousUrlAttributes(url);
if(safeUrlAttributes!=null){
return safeUrlAttributes;
}
IUser loginUser=ContextHolder.getLoginUser();
if(loginUser==null){
throw new NoneLoginException("Please login first");
}
String orgCompanyId=loginUser.getCompanyId();
Assert.hasText(orgCompanyId, "current login user["+ContextHolder.getLoginUser().getUsername()+"] is not specified company ID");
String[] companyIds=orgCompanyId.split(",");
List<ConfigAttribute> attributes=null;
for(String companyId:companyIds){
attributes=loadUrlConfigAttributes(url,companyId);
if(attributes!=null)break;
}
if(attributes==null){
if(!useConservativeAuthorityStrategy || loginUser.isAdministrator()){
return CollectionUtils.EMPTY_COLLECTION;
}else{
throw new AccessDeniedException("Access denied");
}
}
if(attributes.size()>0){
return attributes;
}else{
if(!useConservativeAuthorityStrategy || loginUser.isAdministrator()){
return attributes;
}else{
throw new AccessDeniedException("Access denied");
}
}
}
示例2: getAllConfigAttributes
@SuppressWarnings("unchecked")
public Collection<ConfigAttribute> getAllConfigAttributes() {
return CollectionUtils.EMPTY_COLLECTION;
}
示例3: getAuthorities
@SuppressWarnings("unchecked")
public final Collection<? extends GrantedAuthority> getAuthorities() {
return getRoles()==null?CollectionUtils.EMPTY_COLLECTION:getRoles();
}