|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.xmlpull.v1.builder.xpath.jaxen.SimpleVariableContext
public class SimpleVariableContext
Simple default implementation for VariableContext.
This is a simple table-based key-lookup implementation
for VariableContext which can be programmatically
extended by setting additional variables.
| Constructor Summary | |
|---|---|
SimpleVariableContext()
Construct. |
|
| Method Summary | |
|---|---|
java.lang.Object |
getVariableValue(java.lang.String namespaceURI,
java.lang.String prefix,
java.lang.String localName)
An implementation should return the value of an xpath variable based on the namespace uri and local name of the variable-reference expression. |
void |
setVariableValue(java.lang.String localName,
java.lang.Object value)
Set the value associated with a variable. |
void |
setVariableValue(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.Object value)
Set the value associated with a variable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleVariableContext()
Construct with an empty variable lookup table.
| Method Detail |
|---|
public void setVariableValue(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.Object value)
This method sets a variable that is
associated with any particular namespace.
These variables appear such as $prefix:foo
in an XPath expression. Prefix to URI resolution
is the responsibility of a NamespaceContext.
Variables within a VariableContext are
refered to purely based upon their namespace URI,
if any.
namespaceURI - The namespace URI of the variable.localName - The local name of the variablevalue - The value to be bound to the variable.
public void setVariableValue(java.lang.String localName,
java.lang.Object value)
This method sets a variable that is not
associated with any particular namespace.
These variables appear such as $foo
in an XPath expression.
localName - The local name of the variablevalue - The value to be bound to the variable.
public java.lang.Object getVariableValue(java.lang.String namespaceURI,
java.lang.String prefix,
java.lang.String localName)
throws UnresolvableException
VariableContextIt must not use the prefix parameter to select a variable, because a prefix could be bound to any namespace; the prefix parameter could be used in debugging output or other generated information. The prefix may otherwise be ignored.
getVariableValue in interface VariableContextnamespaceURI - the namespace uri to which the prefix parameter
is bound in the xpath expression. If the variable
reference expression had no prefix, the namespace
uri is null.prefix - the prefix that was used in the variable reference
expression.localName - the local name of the variable-reference
expression; if there is no prefix, then this is
the whole name of the variable.
null)
UnresolvableException - when the variable cannot be resolved.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||