Sha256: 3dbadedff46c629b3104312f9651383ff1c35ce6910b79660ffd8370150a0eb5

Contents?: true

Size: 890 Bytes

Versions: 3

Compression:

Stored size: 890 Bytes

Contents

package nokogiri.internals;

import java.util.HashMap;
import javax.xml.namespace.QName;
import javax.xml.xpath.XPathVariableResolver;

/**
 * XPath variable support
 *
 * @author Ken Bloom <kbloom@gmail.com>
 * @author Yoko Harada <yokolet@gmail.com>
 */
public class NokogiriXPathVariableResolver implements XPathVariableResolver
{

  private final HashMap<QName, String> variables = new HashMap<QName, String>();

  public static NokogiriXPathVariableResolver
  create()
  {
    return new NokogiriXPathVariableResolver();
  }

  private
  NokogiriXPathVariableResolver() {}

  public Object
  resolveVariable(QName variableName)
  {
    return variables.get(variableName);
  }
  public void
  registerVariable(String name, String value)
  {
    variables.put(new QName(name), value);
  }
  public void
  deregisterVariable(String name)
  {
    variables.remove(new QName(name));
  }

}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nokogiri-1.18.2-java ext/java/nokogiri/internals/NokogiriXPathVariableResolver.java
nokogiri-1.18.1-java ext/java/nokogiri/internals/NokogiriXPathVariableResolver.java
nokogiri-1.18.0-java ext/java/nokogiri/internals/NokogiriXPathVariableResolver.java