org.openxml.dom.traversal
Class AttrValueNodeFilter

java.lang.Object
  extended by org.openxml.dom.traversal.AttrValueNodeFilter
All Implemented Interfaces:
org.w3c.dom.traversal.NodeFilter

public final class AttrValueNodeFilter
extends Object
implements org.w3c.dom.traversal.NodeFilter

Implements an attribute value filter. When this filter is used with a node iterator, the iterator will only return elements which have this attribute and can match the attribute's value.

A node filter can be shared by multiple iterators. When a filters is reused, it is better to retrieve a copy of the filter from a static list. This mechanism is supported by calling the static method lookup(java.lang.String, java.lang.String) and should be used for named filters that are routinely reused.

See Also:
NodeFilter, NodeIterator

Field Summary
 
Fields inherited from interface org.w3c.dom.traversal.NodeFilter
FILTER_ACCEPT, FILTER_REJECT, FILTER_SKIP, SHOW_ALL, SHOW_ATTRIBUTE, SHOW_CDATA_SECTION, SHOW_COMMENT, SHOW_DOCUMENT, SHOW_DOCUMENT_FRAGMENT, SHOW_DOCUMENT_TYPE, SHOW_ELEMENT, SHOW_ENTITY, SHOW_ENTITY_REFERENCE, SHOW_NOTATION, SHOW_PROCESSING_INSTRUCTION, SHOW_TEXT
 
Method Summary
 short acceptNode(Node node)
           
static org.w3c.dom.traversal.NodeFilter lookup(String attrName, String attrValue)
          Returns a node filter for the specified attribute name and value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

acceptNode

public short acceptNode(Node node)
Specified by:
acceptNode in interface org.w3c.dom.traversal.NodeFilter

lookup

public static org.w3c.dom.traversal.NodeFilter lookup(String attrName,
                                                      String attrValue)
Returns a node filter for the specified attribute name and value. This method should be used for recurring filter as only one filter is held for each filtered name.

Parameters:
attrName - The filtered attribute's name
attrValue - The filtered attribute's value
Returns:
A suitable node filter


Phantom® and NetPhantom® are registered trademarks of Codectica Systems SARL.
© Copyright Codectica Systems SARL, 2008. All rights reserved.