Example usage for org.apache.commons.jxpath Variables undeclareVariable

List of usage examples for org.apache.commons.jxpath Variables undeclareVariable

Introduction

In this page you can find the example usage for org.apache.commons.jxpath Variables undeclareVariable.

Prototype

void undeclareVariable(String varName);

Source Link

Document

Removes an existing variable.

Usage

From source file:org.chiba.xml.xforms.xpath.CoreExtensionFunctions.java

/**
 * Undeclares the specified variable an returns its value.
 *
 * @param expressionContext the expression context.
 * @param name the name of the variable.
 * @return the value of the variable.//from   w w w  . jav a  2  s . c  o m
 */
public static Object undeclare(ExpressionContext expressionContext, String name) {
    Variables variables = expressionContext.getJXPathContext().getVariables();
    Object value = variables.getVariable(name);
    variables.undeclareVariable(name);

    return value;
}