本文整理汇总了Java中sun.security.provider.PolicyParser.PrincipalEntry.getPrincipalName方法的典型用法代码示例。如果您正苦于以下问题:Java PrincipalEntry.getPrincipalName方法的具体用法?Java PrincipalEntry.getPrincipalName怎么用?Java PrincipalEntry.getPrincipalName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.security.provider.PolicyParser.PrincipalEntry
的用法示例。
在下文中一共展示了PrincipalEntry.getPrincipalName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toString
import sun.security.provider.PolicyParser.PrincipalEntry; //导入方法依赖的package包/类
/**
* Return a String representation of this <code>SubjectCodeSource</code>.
*
* <p>
*
* @return a String representation of this <code>SubjectCodeSource</code>.
*/
public String toString() {
String returnMe = super.toString();
if (getSubject() != null) {
if (debug != null) {
final Subject finalSubject = getSubject();
returnMe = returnMe + "\n" +
java.security.AccessController.doPrivileged
(new java.security.PrivilegedAction<String>() {
public String run() {
return finalSubject.toString();
}
});
} else {
returnMe = returnMe + "\n" + getSubject().toString();
}
}
if (principals != null) {
ListIterator<PrincipalEntry> li = principals.listIterator();
while (li.hasNext()) {
PrincipalEntry pppe = li.next();
returnMe = returnMe + rb.getString("NEWLINE") +
pppe.getPrincipalClass() + " " +
pppe.getPrincipalName();
}
}
return returnMe;
}
示例2: toString
import sun.security.provider.PolicyParser.PrincipalEntry; //导入方法依赖的package包/类
/**
* Return a String representation of this <code>SubjectCodeSource</code>.
*
* <p>
*
* @return a String representation of this <code>SubjectCodeSource</code>.
*/
public String toString() {
String returnMe = super.toString();
if (getSubject() != null) {
if (debug != null) {
final Subject finalSubject = getSubject();
returnMe = returnMe + "\n" +
java.security.AccessController.doPrivileged
(new java.security.PrivilegedAction<String>() {
public String run() {
return finalSubject.toString();
}
});
} else {
returnMe = returnMe + "\n" + getSubject().toString();
}
}
if (principals != null) {
ListIterator<PrincipalEntry> li = principals.listIterator();
while (li.hasNext()) {
PrincipalEntry pppe = li.next();
returnMe = returnMe + ResourcesMgr.getAuthResourceString("NEWLINE") +
pppe.getPrincipalClass() + " " +
pppe.getPrincipalName();
}
}
return returnMe;
}