com.gargoylesoftware.htmlunit.javascript.host
Class NodeFilter

java.lang.Object
  extended by net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
      extended by com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
          extended by com.gargoylesoftware.htmlunit.javascript.host.NodeFilter
All Implemented Interfaces:
Serializable, Cloneable, Map, net.sourceforge.htmlunit.corejs.javascript.ConstProperties, net.sourceforge.htmlunit.corejs.javascript.debug.DebuggableObject, net.sourceforge.htmlunit.corejs.javascript.Scriptable

public class NodeFilter
extends SimpleScriptable

A NodeFilter.

Version:
$Revision: 5301 $
Author:
Mike Dirolf
See Also:
DOM-Level-2-Traversal-Range, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
static short FILTER_ACCEPT
          Accept the node.
static short FILTER_REJECT
          Reject the node.
static short FILTER_SKIP
          Skip the node.
static int SHOW_ALL
          Show all nodes.
static int SHOW_ATTRIBUTE
          Show Attr nodes.
static int SHOW_CDATA_SECTION
          Show CDATASection nodes.
static int SHOW_COMMENT
          Show Comment nodes.
static int SHOW_DOCUMENT
          Show Document nodes.
static int SHOW_DOCUMENT_FRAGMENT
          Show DocumentFragment nodes.
static int SHOW_DOCUMENT_TYPE
          Show DocumentType nodes.
static int SHOW_ELEMENT
          Show Element nodes.
static int SHOW_ENTITY
          Show Entity nodes.
static int SHOW_ENTITY_REFERENCE
          Show EntityReference nodes.
static int SHOW_NOTATION
          Show Notation nodes.
static int SHOW_PROCESSING_INSTRUCTION
          Show ProcessingInstruction nodes.
static int SHOW_TEXT
          Show Text nodes.
 
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
NodeFilter()
           
 
Method Summary
 short acceptNode(Node n)
          Test whether a specified node is visible in the logical view of a TreeWalker.
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, clear, containsKey, containsValue, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, entrySet, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, keySet, preventExtensions, put, put, put, putAll, putConst, putConstProperty, putProperty, putProperty, redefineProperty, remove, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size, values
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

FILTER_ACCEPT

public static final short FILTER_ACCEPT
Accept the node. TreeWalker navigation will return this node.

See Also:
Constant Field Values

FILTER_REJECT

public static final short FILTER_REJECT
Reject the node. TreeWalker navigation will not return this node or any of it's children.

See Also:
Constant Field Values

FILTER_SKIP

public static final short FILTER_SKIP
Skip the node. TreeWalker navigation will not return this node, but WILL still consider the children of this node.

See Also:
Constant Field Values

SHOW_ALL

public static final int SHOW_ALL
Show all nodes.

See Also:
Constant Field Values

SHOW_ELEMENT

public static final int SHOW_ELEMENT
Show Element nodes.

See Also:
Constant Field Values

SHOW_ATTRIBUTE

public static final int SHOW_ATTRIBUTE
Show Attr nodes. Only useful when creating a TreeWalker with an attribute node as its root.

See Also:
Constant Field Values

SHOW_TEXT

public static final int SHOW_TEXT
Show Text nodes.

See Also:
Constant Field Values

SHOW_CDATA_SECTION

public static final int SHOW_CDATA_SECTION
Show CDATASection nodes.

See Also:
Constant Field Values

SHOW_ENTITY_REFERENCE

public static final int SHOW_ENTITY_REFERENCE
Show EntityReference nodes.

See Also:
Constant Field Values

SHOW_ENTITY

public static final int SHOW_ENTITY
Show Entity nodes.

See Also:
Constant Field Values

SHOW_PROCESSING_INSTRUCTION

public static final int SHOW_PROCESSING_INSTRUCTION
Show ProcessingInstruction nodes.

See Also:
Constant Field Values

SHOW_COMMENT

public static final int SHOW_COMMENT
Show Comment nodes.

See Also:
Constant Field Values

SHOW_DOCUMENT

public static final int SHOW_DOCUMENT
Show Document nodes.

See Also:
Constant Field Values

SHOW_DOCUMENT_TYPE

public static final int SHOW_DOCUMENT_TYPE
Show DocumentType nodes.

See Also:
Constant Field Values

SHOW_DOCUMENT_FRAGMENT

public static final int SHOW_DOCUMENT_FRAGMENT
Show DocumentFragment nodes.

See Also:
Constant Field Values

SHOW_NOTATION

public static final int SHOW_NOTATION
Show Notation nodes. Only useful when creating a TreeWalker with a Notation node as its root.

See Also:
Constant Field Values
Constructor Detail

NodeFilter

public NodeFilter()
Method Detail

acceptNode

public short acceptNode(Node n)
Test whether a specified node is visible in the logical view of a TreeWalker. This is not normally called directly from user code.

Parameters:
n - The node to check to see if it passes the filter or not.
Returns:
a constant to determine whether the node is accepted, rejected, or skipped.


Copyright © 2002-2011 Gargoyle Software Inc.. All Rights Reserved.