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