public void setGlobalVariable ( String name , Element value , boolean finalFlag ) { assert ( name != null ) ; // Either modify an existing value (with appropriate checks) or add a // new one. if ( globalVariables . containsKey ( name ) ) { GlobalVariable gvar = globalVariables . get ( name ) ; gvar . setValue ( value ) ; gvar . setFinalFlag ( finalFlag ) ; } else if ( value != null ) { GlobalVariable gvar = new GlobalVariable ( finalFlag , value ) ; globalVariables . put ( name , gvar ) ; } }
Set the variable to the given value . If the value is null then the variable will be removed from the context .