dk.brics.xpath.evaluator
Class EvaluationContext

java.lang.Object
  extended by dk.brics.xpath.evaluator.EvaluationContext

public class EvaluationContext
extends Object

Evalution context used by XPathEvaluator.


Constructor Summary
EvaluationContext()
          Constructs a default evalution context.
 
Method Summary
 void addNamespaces(Map<String,String> map)
          Adds all namespaces from given map.
 Automaton getCanonicalName(NameTest t, boolean attribute)
          Gets the canonical name for a name test node by expanding its prefix to the corresponding URI and allowing all possible xsi-attribute suffixes.
 String getDefaultNamespace()
          Gets the default namespace URI.
 String getNamespace(String prefix)
          Gets the namespace URI for a prefix.
 void setDefaultNamespace(String uri)
          Sets the default namespace URI.
 void setNamespace(String prefix, String uri)
          Sets the namespace URI for a prefix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EvaluationContext

public EvaluationContext()
Constructs a default evalution context. The default namespace URI is the empty string, and the namespace URI map is empty.

Method Detail

addNamespaces

public void addNamespaces(Map<String,String> map)
Adds all namespaces from given map.

Parameters:
map - map from prefix to namespace uri

getCanonicalName

public Automaton getCanonicalName(NameTest t,
                                  boolean attribute)
Gets the canonical name for a name test node by expanding its prefix to the corresponding URI and allowing all possible xsi-attribute suffixes. The default URI will be used if there is no prefix.

Parameters:
t - test node
Returns:
canonical name

getDefaultNamespace

public String getDefaultNamespace()
Gets the default namespace URI.

Returns:
default namespace

getNamespace

public String getNamespace(String prefix)
Gets the namespace URI for a prefix.

Parameters:
prefix - the prefix to lookup
Returns:
namespace URI (null if not found)

setDefaultNamespace

public void setDefaultNamespace(String uri)
Sets the default namespace URI.

Parameters:
uri - default namespace

setNamespace

public void setNamespace(String prefix,
                         String uri)
Sets the namespace URI for a prefix.

Parameters:
prefix - the prefix
uri - the uri


Copyright © 2005-2010 Anders Møller.