context.setRoot(arguments); Object res = Ognl.getValue(object, context, context.getRoot(), valueType); return (T) res;
public void clear() { _values.clear(); _typeStack.clear(); _accessorStack.clear(); _localReferenceCounter = 0; if (_localReferenceMap != null) { _localReferenceMap.clear(); } setRoot(null); setCurrentObject(null); setRootEvaluation(null); setCurrentEvaluation(null); setLastEvaluation(null); setCurrentNode(null); }
protected void setValueBody(OgnlContext context, Object target, Object value) throws OgnlException { context.setRoot(value); }
public void clear() { _values.clear(); _typeStack.clear(); _accessorStack.clear(); _localReferenceCounter = 0; if (_localReferenceMap != null) { _localReferenceMap.clear(); } setRoot(null); setCurrentObject(null); setRootEvaluation(null); setCurrentEvaluation(null); setLastEvaluation(null); setCurrentNode(null); }
protected void setValueBody(OgnlContext context, Object target, Object value) throws OgnlException { context.setRoot(value); }
public void clear() { values.clear(); setRoot(null); setCurrentObject(null); setRootEvaluation(null); setCurrentEvaluation(null); setLastEvaluation(null); setCurrentNode(null); setClassResolver(DEFAULT_CLASS_RESOLVER); setTypeConverter(DEFAULT_TYPE_CONVERTER); setMemberAccess(DEFAULT_MEMBER_ACCESS); }
protected void setValueBody( OgnlContext context, Object target, Object value ) throws OgnlException { context.setRoot( value ); }
/** * Appends the standard naming context for evaluating an OGNL expression into the context given * so that cached maps can be used as a context. * * @param root * the root of the object graph * @param memberAccess * Definition for handling private/protected access. * @param classResolver * The class loading resolver that should be used to resolve class references. * @param converter * The type converter to be used by default. * @param context * Default context to use, if not an {@link OgnlContext} will be dumped into * a new {@link OgnlContext} object. * @return Context Map with the keys <CODE>root</CODE> and <CODE>context</CODE> set * appropriately */ public static Map addDefaultContext(Object root, MemberAccess memberAccess, ClassResolver classResolver, TypeConverter converter, Map context) { OgnlContext result; if (context instanceof OgnlContext) { result = (OgnlContext) context; } else { result = new OgnlContext(memberAccess, classResolver, converter, context); } result.setRoot(root); return result; }
protected void setValueBody(OgnlContext context, Object target, Object value) throws OgnlException { Object expr = _children[0].getValue(context, target), previousRoot = context.getRoot(); Node node; target = _children[1].getValue(context, target); node = (expr instanceof Node) ? (Node) expr : (Node) Ognl.parseExpression(expr.toString()); try { context.setRoot(target); node.setValue(context, target, value); } finally { context.setRoot(previousRoot); } }
public void activateObject(Object obj) throws Exception { OgnlContext context = (OgnlContext)obj; if (context.getRoot() != null || context.getValues().size() > 0) { context.clear(); context.setRoot(null); } } }
protected Object getValueBody(OgnlContext context, Object source) throws OgnlException { Object result, expr = _children[0].getValue(context, source), previousRoot = context.getRoot(); Node node; source = _children[1].getValue(context, source); node = (expr instanceof Node) ? (Node) expr : (Node) Ognl.parseExpression(expr.toString()); try { context.setRoot(source); result = node.getValue(context, source); } finally { context.setRoot(previousRoot); } return result; }
protected void setValueBody( OgnlContext context, Object target, Object value ) throws OgnlException { Object expr = children[0].getValue(context, target), previousRoot = context.getRoot(); Node node; target = children[1].getValue( context, target ); node = (expr instanceof Node) ? (Node) expr : (Node) Ognl.parseExpression( expr.toString() ); try { context.setRoot( target ); node.setValue( context, target, value ); } finally { context.setRoot( previousRoot ); } }
protected void setValueBody(OgnlContext context, Object target, Object value) throws OgnlException { Object expr = _children[0].getValue(context, target), previousRoot = context.getRoot(); Node node; target = _children[1].getValue(context, target); node = (expr instanceof Node) ? (Node) expr : (Node) Ognl.parseExpression(expr.toString()); try { context.setRoot(target); node.setValue(context, target, value); } finally { context.setRoot(previousRoot); } }
protected Object getValueBody(OgnlContext context, Object source) throws OgnlException { Object result, expr = _children[0].getValue(context, source), previousRoot = context.getRoot(); Node node; source = _children[1].getValue(context, source); node = (expr instanceof Node) ? (Node) expr : (Node) Ognl.parseExpression(expr.toString()); try { context.setRoot(source); result = node.getValue(context, source); } finally { context.setRoot(previousRoot); } return result; }
protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException { Object result, expr = children[0].getValue( context, source ), previousRoot = context.getRoot(); Node node; source = children[1].getValue( context, source ); node = (expr instanceof Node) ? (Node) expr : (Node) Ognl.parseExpression( expr.toString() ); try { context.setRoot( source ); result = node.getValue( context, source ); } finally { context.setRoot( previousRoot ); } return result; }
public Object readCompiled(Object target, Object expression) { OgnlContext context = null; try { context = (OgnlContext)_contextPool.borrowObject(); context.setRoot(target); return Ognl.getValue(expression, context, target); } catch (Exception ex) { throw new ApplicationRuntimeException(ImplMessages.unableToReadExpression(ImplMessages .parsedExpression(), target, ex), target, null, ex); } finally { try { if (context != null) _contextPool.returnObject(context); } catch (Exception e) {} } }
public Object readCompiled(Object target, Object expression) { OgnlContext context = null; try { context = (OgnlContext)_contextPool.borrowObject(); context.setRoot(target); return Ognl.getValue(expression, context, target); } catch (Exception ex) { throw new ApplicationRuntimeException(ImplMessages.unableToReadExpression(ImplMessages .parsedExpression(), target, ex), target, null, ex); } finally { try { if (context != null) _contextPool.returnObject(context); } catch (Exception e) {} } }
public void write(Object target, ExpressionAccessor expression, Object value) { OgnlContext context = null; try { context = (OgnlContext)_contextPool.borrowObject(); // setup context context.setRoot(target); expression.set(context, target, value); } catch (Exception ex) { throw new ApplicationRuntimeException(ImplMessages.unableToWriteExpression(ImplMessages .parsedExpression(), target, value, ex), target, null, ex); } finally { try { if (context != null) _contextPool.returnObject(context); } catch (Exception e) {} } }
@Override public void setProperty(Map context, Object array, Object key, Object value) throws OgnlException { int index = (Integer) key; int length = Array.getLength(array); if (length <= index) { Object newArray = copyOf(array, index, length); OgnlContext ctx = (OgnlContext) context; if (array == ctx.getRoot()) { ctx.setRoot(newArray); } else { String fieldName = ctx.getCurrentEvaluation().getPrevious().getNode().toString(); Object origin = ctx.getCurrentEvaluation().getPrevious().getSource(); Proxifier proxifier = (Proxifier) context.get("proxifier"); Method setter = new ReflectionBasedNullHandler(proxifier).findMethod(origin.getClass(), "set" + StringUtils.capitalize(fieldName), origin.getClass(), null); EmptyElementsRemoval removal = (EmptyElementsRemoval) context.get("removal"); removal.add(newArray, setter, origin); new Mirror().on(origin).invoke().method(setter).withArgs(newArray); } array = newArray; } super.setProperty(context, array, key, value); }
public void write(Object target, ExpressionAccessor expression, Object value) { OgnlContext context = null; try { context = (OgnlContext)_contextPool.borrowObject(); // setup context context.setRoot(target); context.setCurrentObject(target); expression.set(context, target, value); } catch (Exception ex) { throw new ApplicationRuntimeException(ImplMessages.unableToWriteExpression(ImplMessages .parsedExpression(), target, value, ex), target, null, ex); } finally { try { if (context != null) _contextPool.returnObject(context); } catch (Exception e) {} } }