本文整理汇总了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);
}