本文整理汇总了Java中javax.naming.directory.SearchControls.OBJECT_SCOPE属性的典型用法代码示例。如果您正苦于以下问题:Java SearchControls.OBJECT_SCOPE属性的具体用法?Java SearchControls.OBJECT_SCOPE怎么用?Java SearchControls.OBJECT_SCOPE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.naming.directory.SearchControls
的用法示例。
在下文中一共展示了SearchControls.OBJECT_SCOPE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ContextEnumerator
protected ContextEnumerator(Context context, int scope, String contextName,
boolean returnSelf)
throws NamingException {
if(context == null) {
throw new IllegalArgumentException("null context passed");
}
root = context;
// No need to list children if we're only searching object
if (scope != SearchControls.OBJECT_SCOPE) {
children = getImmediateChildren(context);
}
this.scope = scope;
this.contextName = contextName;
// pretend root is processed, if we're not supposed to return ourself
rootProcessed = !returnSelf;
prepNextChild();
}
示例2: next
public Binding next() throws NamingException {
if (!rootProcessed) {
rootProcessed = true;
return new Binding("", root.getClass().getName(),
root, true);
}
if (scope != SearchControls.OBJECT_SCOPE && hasMoreDescendants()) {
return getNextDescendant();
}
throw new NoSuchElementException();
}
示例3: hasMore
public boolean hasMore() throws NamingException {
return !rootProcessed ||
(scope != SearchControls.OBJECT_SCOPE && hasMoreDescendants());
}