当前位置: 首页>>代码示例>>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;未经允许,请勿转载。