當前位置: 首頁>>代碼示例>>Java>>正文


Java AttributeNamedPersonImpl類代碼示例

本文整理匯總了Java中org.jasig.services.persondir.support.AttributeNamedPersonImpl的典型用法代碼示例。如果您正苦於以下問題:Java AttributeNamedPersonImpl類的具體用法?Java AttributeNamedPersonImpl怎麽用?Java AttributeNamedPersonImpl使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AttributeNamedPersonImpl類屬於org.jasig.services.persondir.support包,在下文中一共展示了AttributeNamedPersonImpl類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getPerson

import org.jasig.services.persondir.support.AttributeNamedPersonImpl; //導入依賴的package包/類
@Override
public IPersonAttributes getPerson(String uid) {
    Map<String, List<Object>> attributes = new HashMap<String, List<Object>>();
    try {
        MyUser user = userDaoJdbc.getByUsername(uid);
        if(user.getId()!=null && !"".equalsIgnoreCase(user.getId()))
        attributes.put("userId", Collections.singletonList((Object)user.getId()));
        
        if(user.getUsername()!=null && !"".equalsIgnoreCase(user.getUsername()))
        attributes.put("username", Collections.singletonList((Object)user.getUsername()));
        
        if(user.getPassword()!=null && !"".equalsIgnoreCase(user.getPassword()))
        attributes.put("password", Collections.singletonList((Object)user.getPassword()));
        
        if(user.getTheStatus()!=null)
        attributes.put("status", Collections.singletonList((Object)user.getTheStatus()));
        
        if(user.getName()!=null && !"".equalsIgnoreCase(user.getName()))
        attributes.put("name", Collections.singletonList((Object)URLEncoder.encode(user.getName(), "UTF-8")));
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }
    return new AttributeNamedPersonImpl(attributes);
}
 
開發者ID:thinkfree2015,項目名稱:p00,代碼行數:25,代碼來源:UserStubPersonAttributeDao.java

示例2: getPerson

import org.jasig.services.persondir.support.AttributeNamedPersonImpl; //導入依賴的package包/類
@Override
public IPersonAttributes getPerson(String uid) {
    Map<String, List<Object>> attributes = new HashMap<String, List<Object>>();
    try {
        User user = userDaoJdbc.getByUsername(uid);
        attributes.put("userId", Collections.singletonList((Object)user.getUsercode()));
        attributes.put("username", Collections.singletonList((Object)user.getUsername()));
        attributes.put("usernamePlain", Collections.singletonList((Object)URLEncoder.encode(user.getUsernamePlain(), "UTF-8")));
        attributes.put("blogURL", Collections.singletonList((Object)"http://blog.csdn.net/jadyer"));
        attributes.put("blogger", Collections.singletonList((Object)URLEncoder.encode("玄玉", "UTF-8")));
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }
    return new AttributeNamedPersonImpl(attributes);
}
 
開發者ID:v5java,項目名稱:demo-cas-server-web,代碼行數:16,代碼來源:UserStubPersonAttributeDao.java


注:本文中的org.jasig.services.persondir.support.AttributeNamedPersonImpl類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。