org.apache.directory.shared.ldap.name.DN.isChildOf()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中org.apache.directory.shared.ldap.name.DN.isChildOf()方法的一些代码示例,展示了DN.isChildOf()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DN.isChildOf()方法的具体详情如下:
包路径:org.apache.directory.shared.ldap.name.DN
类名称:DN
方法名:isChildOf

DN.isChildOf介绍

[英]Tells if a DN is a child of another DN.
For instance, dc=example, dc=com is a child of dc=com
[中]说明一个DN是否是另一个DN的子DN。
例如,dc=example,dc=com是dc=com的子级

代码示例

代码示例来源:origin: org.apache.directory.shared/shared-ldap

/**
 * Tests to see if a candidate entry is a descendant of a base.
 * 
 * @param ancestor the base ancestor
 * @param descendant the candidate to test for descendancy
 * @return true if the candidate is a descendant
 */
public static boolean isDescendant( DN ancestor, DN descendant )
{
  return descendant.isChildOf( ancestor );
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

/**
 * Tells if the current DN is a parent of another DN.<br>
 * For instance, <b>dc=com</b> is a parent
 * of <b>dc=example, dc=com</b>
 * 
 * @param dn The child
 * @return true if the current DN is a parent of the given DN
 */
public boolean isParentOf( DN dn )
{
  if ( dn == null )
  {
    return false;
  }
  
  return dn.isChildOf( this );
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

/**
 * Tells if a DN is a child of another DN.<br>
 * For instance, <b>dc=example, dc=com</b> is a child
 * of <b>dc=com</b>
 * 
 * @param dn The parent
 * @return true if the current DN is a child of the given DN
 */
public boolean isChildOf( String dn )
{
  try
  {
    return isChildOf( new DN( dn ) );
  }
  catch( LdapInvalidDnException lide )
  {
    return false;
  }
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

/**
 * Checks to see if two names are siblings.
 * 
 * @param name1 the first name
 * @param name2 the second name
 * @return true if the names are siblings, false otherwise.
 */
public static boolean isSibling( DN name1, DN name2 ) throws LdapInvalidDnException
{
  if ( name1.size() == name2.size() )
  {
    DN parentDn = ( DN ) name1.clone();
    parentDn.remove( name1.size() - 1 );
    return name2.isChildOf( parentDn );
  }
  return false;
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

if ( rdn.isChildOf( ancestor ) )

代码示例来源:origin: org.apache.directory.server/apacheds-avl-partition

if ( aliasDn.isChildOf( normalizedAliasTargetDn ) )
if ( !normalizedAliasTargetDn.isChildOf( suffixDn ) )
if ( !aliasDn.isChildOf( normalizedAliasTargetParentDn ) )

相关文章