public String toString(String prefix) { return prefix + OgnlParserTreeConstants.jjtNodeName[_id] + " " + toString(); }
private boolean isSimpleMethod(Object tree, Map<String, Object> context) throws OgnlException { if (tree instanceof SimpleNode) { SimpleNode node = (SimpleNode) tree; OgnlContext ognlContext = null; if (context!=null && context instanceof OgnlContext) { ognlContext = (OgnlContext) context; } return node.isSimpleMethod(ognlContext) && !node.isChain(ognlContext); } return false; }
private boolean isEvalExpression(Object tree, Map<String, Object> context) throws OgnlException { if (tree instanceof SimpleNode) { SimpleNode node = (SimpleNode) tree; OgnlContext ognlContext = null; if (context!=null && context instanceof OgnlContext) { ognlContext = (OgnlContext) context; } return node.isEvalChain(ognlContext) || node.isSequence(ognlContext); } return false; }
protected Object evaluateGetValueBody( OgnlContext context, Object source ) throws OgnlException { Object result; context.setCurrentObject(source); context.setCurrentNode(this); if (!constantValueCalculated) { constantValueCalculated = true; hasConstantValue = isConstant(context); if (hasConstantValue) { constantValue = getValueBody(context, source); } } return hasConstantValue ? constantValue : getValueBody(context, source); }
public boolean isNodeSimpleProperty(OgnlContext context) throws OgnlException { return (_children != null) && (_children.length == 1) && ((SimpleNode) _children[0]).isConstant(context); }
@Override public boolean isOperation(OgnlContext context) throws OgnlException { if (_children.length == 1) { SimpleNode child = (SimpleNode) _children[0]; return child.isOperation(context) || !child.isConstant(context); } return super.isOperation(context); } }
int indexInParent = ctx.getCurrentEvaluation().getNode().getIndexInParent(); int maxIndex = ctx.getRootEvaluation().getNode().jjtGetNumChildren() - 1;
public Node getNextSibling() { Node result = null; int i = getIndexInParent(); if (i >= 0) { int icount = _parent.jjtGetNumChildren(); if (i < icount) { result = _parent.jjtGetChild(i + 1); } } return result; }
public boolean isConstant(OgnlContext context) throws OgnlException { return isNodeConstant(context); }
result = evaluateGetValueBody(context, source); result = evaluateGetValueBody(context, source);
public final void setValue( OgnlContext context, Object target, Object value ) throws OgnlException { if (context.getTraceEvaluations()) { EvaluationPool pool = OgnlRuntime.getEvaluationPool(); Throwable evalException = null; Evaluation evaluation = pool.create(this, target, true); context.pushEvaluation(evaluation); try { evaluateSetValueBody(context, target, value); } catch (OgnlException ex) { evalException = ex; ex.setEvaluation(evaluation); throw ex; } catch (RuntimeException ex) { evalException = ex; throw ex; } finally { Evaluation eval = context.popEvaluation(); if (evalException != null) { eval.setException(evalException); } if ((evalException == null) && (context.getRootEvaluation() == null) && !context.getKeepLastEvaluation()) { pool.recycleAll(eval); } } } else { evaluateSetValueBody(context, target, value); } }
public boolean isEvalChain(OgnlContext context) throws OgnlException { if (_children == null) { return false; } for (Node child : _children) { if (child instanceof SimpleNode) { if (((SimpleNode) child).isEvalChain(context)) { return true; } } } return false; }
public boolean isChain(OgnlContext context) throws OgnlException { if (_children == null) { return false; } for (Node child : _children) { if (child instanceof SimpleNode) { if (((SimpleNode) child).isChain(context)) { return true; } } } return false; }
protected Object evaluateGetValueBody(OgnlContext context, Object source) throws OgnlException { context.setCurrentObject(source); context.setCurrentNode(this); if (!_constantValueCalculated) { _constantValueCalculated = true; boolean constant = isConstant(context); if (constant) { _constantValue = getValueBody(context, source); } _hasConstantValue = constant; } return _hasConstantValue ? _constantValue : getValueBody(context, source); }
public boolean isNodeSimpleProperty( OgnlContext context ) throws OgnlException { return (children != null) && (children.length == 1) && ((SimpleNode)children[0]).isConstant(context); }
@Override public boolean isOperation(OgnlContext context) throws OgnlException { if (_children.length == 1) { SimpleNode child = (SimpleNode) _children[0]; return child.isOperation(context) || !child.isConstant(context); } return super.isOperation(context); } }
public Node getNextSibling() { Node result = null; int i = getIndexInParent(); if (i >= 0) { int icount = parent.jjtGetNumChildren(); if (i < icount) { result = parent.jjtGetChild(i + 1); } } return result; }
public boolean isConstant( OgnlContext context ) throws OgnlException { return isNodeConstant(context); }
result = evaluateGetValueBody(context, source); } catch (OgnlException ex) { evalException = ex; return evaluateGetValueBody(context, source);