com.gargoylesoftware.htmlunit.html.XPathDomNodeList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of htmlunit Show documentation
Show all versions of htmlunit Show documentation
A headless browser intended for use in testing web-based applications.
/*
* Copyright (c) 2002-2011 Gargoyle Software Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.gargoylesoftware.htmlunit.html;
import java.io.Serializable;
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.collections.Transformer;
import org.apache.commons.collections.functors.NOPTransformer;
import org.w3c.dom.Node;
import com.gargoylesoftware.htmlunit.html.xpath.XPathUtils;
/**
* An XPath implementation of {@link org.w3c.dom.NodeList}.
*
* @version $Revision: 6204 $
* @author Daniel Gredler
* @author Tom Anderson
*/
class XPathDomNodeList extends AbstractList implements DomNodeList, Serializable {
/** The XPath expression which dictates the contents of this node list. */
private String xpath_;
/** This node list's root node. */
private DomNode node_;
/** The transformer used to transform elements of this node list, if any. */
private Transformer transformer_;
/** Element cache, used to avoid XPath expression evaluation as much as possible. */
private List