/** * Assimilate the Variables instance associated with the specified context. * @param context JXPathContext to search */ protected void findVariables(JXPathContext context) { valuePointer = null; JXPathContext varCtx = context; while (varCtx != null) { variables = varCtx.getVariables(); if (variables.isDeclaredVariable(name.toString())) { actual = true; break; } varCtx = varCtx.getParentContext(); variables = null; } }
public NodePointer createNodePointer(QName name, Object object, Locale locale) { if (object instanceof VariableContextWrapper) { JXPathContext varCtx = ((VariableContextWrapper) object).getContext(); while (varCtx != null) { Variables vars = varCtx.getVariables(); if (vars.isDeclaredVariable(name.toString())) { return new VariablePointer(vars, name); } varCtx = varCtx.getParentContext(); } // The variable is not declared, but we will create // a pointer anyway in case the user wants to set, rather // than get, the value of the variable. return new VariablePointer(name); } return null; }