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


Java Name.getAll方法代碼示例

本文整理匯總了Java中javax.naming.Name.getAll方法的典型用法代碼示例。如果您正苦於以下問題:Java Name.getAll方法的具體用法?Java Name.getAll怎麽用?Java Name.getAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.naming.Name的用法示例。


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

示例1: addAll

import javax.naming.Name; //導入方法依賴的package包/類
/**
 * Adds the components of a name -- in order -- at a specified position
 * within this name. Components of this LDAP name at or after the
 * index (if any) of the first new component are shifted up
 * (away from index 0) to accommodate the new components.
 *
 * @param suffix    The non-null components to add.
 * @param posn      The index at which to add the new component.
 *                  Must be in the range [0,size()].
 *
 * @return  The updated name (not a new instance).
 *
 * @throws  InvalidNameException if <tt>suffix</tt> is not a valid LDAP
 *          name, or if the addition of the components would violate the
 *          syntax rules of this LDAP name.
 * @throws  IndexOutOfBoundsException
 *          If posn is outside the specified range.
 */
public Name addAll(int posn, Name suffix)
    throws InvalidNameException {
    unparsed = null;        // no longer valid
    if (suffix instanceof LdapName) {
        LdapName s = (LdapName) suffix;
        rdns.addAll(posn, s.rdns);
    } else {
        Enumeration<String> comps = suffix.getAll();
        while (comps.hasMoreElements()) {
            rdns.add(posn++,
                (new Rfc2253Parser(comps.nextElement()).
                parseRdn()));
        }
    }
    return this;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:35,代碼來源:LdapName.java

示例2: addAll

import javax.naming.Name; //導入方法依賴的package包/類
/**
 * Adds the components of a name -- in order -- at a specified position
 * within this name. Components of this LDAP name at or after the
 * index (if any) of the first new component are shifted up
 * (away from index 0) to accommodate the new components.
 *
 * @param suffix    The non-null components to add.
 * @param posn      The index at which to add the new component.
 *                  Must be in the range [0,size()].
 *
 * @return  The updated name (not a new instance).
 *
 * @throws  InvalidNameException if {@code suffix} is not a valid LDAP
 *          name, or if the addition of the components would violate the
 *          syntax rules of this LDAP name.
 * @throws  IndexOutOfBoundsException
 *          If posn is outside the specified range.
 */
public Name addAll(int posn, Name suffix)
    throws InvalidNameException {
    unparsed = null;        // no longer valid
    if (suffix instanceof LdapName) {
        LdapName s = (LdapName) suffix;
        rdns.addAll(posn, s.rdns);
    } else {
        Enumeration<String> comps = suffix.getAll();
        while (comps.hasMoreElements()) {
            rdns.add(posn++,
                (new Rfc2253Parser(comps.nextElement()).
                parseRdn()));
        }
    }
    return this;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:35,代碼來源:LdapName.java


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