public Object[] create(Object singleton) { Object[] result = create(1); result[0] = singleton; return result; }
public static final boolean setMethodValue(OgnlContext context, Object target, String propertyName, Object value, boolean checkAccessAndExistence) throws OgnlException, IllegalAccessException, NoSuchMethodException, MethodFailedException, IntrospectionException { boolean result = true; Method m = getSetMethod(context, (target == null) ? null : target.getClass(), propertyName); if (checkAccessAndExistence) { if ((m == null) || !context.getMemberAccess().isAccessible(context, target, m, propertyName)) { result = false; } } if (result) { if (m != null) { Object[] args = objectArrayPool.create(value); try { callAppropriateMethod(context, target, target, m.getName(), propertyName, Collections.nCopies(1, m), args); } finally { objectArrayPool.recycle(args); } } else { result = false; } } return result; }
public synchronized Object[] create(int arraySize) { return getSizePool(arraySize).create(); }
public static Object callAppropriateMethod( OgnlContext context, Object source, Object target, String methodName, String propertyName, List methods, Object[] args ) throws MethodFailedException Object[] actualArgs = objectArrayPool.create(args.length); { reason = e.getTargetException(); } finally { objectArrayPool.recycle(actualArgs);
public synchronized void recycle(Object[] value) { if (value != null) { getSizePool(value.length).recycle(value); } } }
protected Object getValueBody( OgnlContext context, Object source ) throws OgnlException { Object[] args = OgnlRuntime.getObjectArrayPool().create(jjtGetNumChildren()); Object root = context.getRoot(); try { for ( int i=0, icount = args.length; i < icount; ++i ) args[i] = children[i].getValue(context, root); return OgnlRuntime.callStaticMethod( context, className, methodName, args ); } finally { OgnlRuntime.getObjectArrayPool().recycle(args); } }
public Object[] create(Object object1, Object object2) { Object[] result = create(2); result[0] = object1; result[1] = object2; return result; }
protected Object getValueBody(OgnlContext context, Object source) throws OgnlException { Object[] args = OgnlRuntime.getObjectArrayPool().create(jjtGetNumChildren()); Object root = context.getRoot(); try { for(int i = 0, icount = args.length; i < icount; ++i) args[i] = _children[i].getValue(context, root); return OgnlRuntime.callStaticMethod(context, _className, _methodName, args); } finally { OgnlRuntime.getObjectArrayPool().recycle(args); } }
public Object[] create(Object object1, Object object2, Object object3, Object object4, Object object5) { Object[] result = create(5); result[0] = object1; result[1] = object2; result[2] = object3; result[3] = object4; result[4] = object5; return result; }
public synchronized Object[] create(Object singleton) { Object[] result = create(1); result[0] = singleton; return result; }
public synchronized Object[] create(Object object1, Object object2, Object object3, Object object4) { Object[] result = create(4); result[0] = object1; result[1] = object2; result[2] = object3; result[3] = object4; return result; }
public Object[] create(Object object1, Object object2, Object object3) { Object[] result = create(3); result[0] = object1; result[1] = object2; result[2] = object3; return result; }
protected Object getValueBody(OgnlContext context, Object source) throws OgnlException { Object[] args = OgnlRuntime.getObjectArrayPool().create(jjtGetNumChildren()); Object root = context.getRoot(); try { for(int i = 0, icount = args.length; i < icount; ++i) args[i] = _children[i].getValue(context, root); return OgnlRuntime.callStaticMethod(context, _className, _methodName, args); } finally { OgnlRuntime.getObjectArrayPool().recycle(args); } }
public Object[] create(Object object1, Object object2, Object object3, Object object4) { Object[] result = create(4); result[0] = object1; result[1] = object2; result[2] = object3; result[3] = object4; return result; }
public static final void setIndexedProperty( OgnlContext context, Object source, String name, Object index, Object value ) throws OgnlException { Throwable reason = null; Object[] args = objectArrayPool.create(index, value); try { PropertyDescriptor pd = getPropertyDescriptor((source == null) ? null : source.getClass(), name); Method m; if (pd instanceof IndexedPropertyDescriptor) { m = ((IndexedPropertyDescriptor)pd).getIndexedWriteMethod(); } else { if (pd instanceof ObjectIndexedPropertyDescriptor) { m = ((ObjectIndexedPropertyDescriptor)pd).getIndexedWriteMethod(); } else { throw new OgnlException("property '" + name + "' is not an indexed property"); } } callMethod(context, source, m.getName(), name, args); } catch (OgnlException ex) { throw ex; } catch (Exception ex) { throw new OgnlException("getting indexed property descriptor for '" + name + "'", ex); } finally { objectArrayPool.recycle(args); } }
public Object[] create(Object object1, Object object2, Object object3, Object object4, Object object5) { Object[] result = create(5); result[0] = object1; result[1] = object2; result[2] = object3; result[3] = object4; result[4] = object5; return result; }
public static Object getIndexedProperty(OgnlContext context, Object source, String name, Object index) throws OgnlException { Object[] args = _objectArrayPool.create(index); try { PropertyDescriptor pd = getPropertyDescriptor((source == null) ? null : source.getClass(), name); Method m; if (pd instanceof IndexedPropertyDescriptor) { m = ((IndexedPropertyDescriptor) pd).getIndexedReadMethod(); } else { if (pd instanceof ObjectIndexedPropertyDescriptor) { m = ((ObjectIndexedPropertyDescriptor) pd).getIndexedReadMethod(); } else { throw new OgnlException("property '" + name + "' is not an indexed property"); } } return callMethod(context, source, m.getName(), args); } catch (OgnlException ex) { throw ex; } catch (Exception ex) { throw new OgnlException("getting indexed property descriptor for '" + name + "'", ex); } finally { _objectArrayPool.recycle(args); } }