本文整理匯總了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();
}