if ((f == null) || !context.getMemberAccess().isAccessible(context, target, f, propertyName)) { result = NotFound; state = context.getMemberAccess().setup(context, target, f, propertyName); result = f.get(target); context.getMemberAccess().restore(context, target, f, propertyName, state);
public static boolean setFieldValue(OgnlContext context, Object target, String propertyName, Object value) throws OgnlException { boolean result = false; try { final Field f = getField((target == null) ? null : target.getClass(), propertyName); if (f != null) { final int fModifiers = f.getModifiers(); if (!Modifier.isStatic(f.getModifiers()) && !Modifier.isFinal(fModifiers)) { final Object state = context.getMemberAccess().setup(context, target, f, propertyName); try { if (isTypeCompatible(value, f.getType()) || ((value = getConvertedType(context, target, f, propertyName, value, f.getType())) != null)) { f.set(target, value); result = true; } } finally { context.getMemberAccess().restore(context, target, f, propertyName, state); } } } } catch (IllegalAccessException ex) { throw new NoSuchPropertyException(target, propertyName, ex); } return result; }
public static boolean isFieldAccessible(OgnlContext context, Object target, Field field, String propertyName) { return context.getMemberAccess().isAccessible(context, target, field, propertyName); }
public static boolean isMethodAccessible(OgnlContext context, Object target, Method method, String propertyName) { return (method != null) && context.getMemberAccess().isAccessible(context, target, method, propertyName); }
public static boolean setFieldValue(OgnlContext context, Object target, String propertyName, Object value) throws OgnlException { boolean result = false; try { final Field f = getField((target == null) ? null : target.getClass(), propertyName); if (f != null) { final int fModifiers = f.getModifiers(); if (!Modifier.isStatic(f.getModifiers()) && !Modifier.isFinal(fModifiers)) { final Object state = context.getMemberAccess().setup(context, target, f, propertyName); try { if (isTypeCompatible(value, f.getType()) || ((value = getConvertedType(context, target, f, propertyName, value, f.getType())) != null)) { f.set(target, value); result = true; } } finally { context.getMemberAccess().restore(context, target, f, propertyName, state); } } } } catch (IllegalAccessException ex) { throw new NoSuchPropertyException(target, propertyName, ex); } return result; }
if ((f == null) || !context.getMemberAccess().isAccessible(context, target, f, propertyName)) { result = NotFound; final Object state = context.getMemberAccess().setup(context, target, f, propertyName); try { result = f.get(target); } finally { context.getMemberAccess().restore(context, target, f, propertyName, state);
public static final boolean isFieldAccessible(OgnlContext context, Object target, Field field, String propertyName) { return context.getMemberAccess().isAccessible(context, target, field, propertyName); }
public static final boolean setFieldValue(OgnlContext context, Object target, String propertyName, Object value) throws OgnlException { boolean result = false; try { Field f = getField( (target == null) ? null : target.getClass(), propertyName ); Object state; if ((f != null) && !Modifier.isStatic(f.getModifiers())) { state = context.getMemberAccess().setup(context, target, f, propertyName); try { if (isTypeCompatible(value, f.getType()) || ((value = getConvertedType( context, target, f, propertyName, value, f.getType())) != null)) { f.set(target, value); result = true; } } finally { context.getMemberAccess().restore(context, target, f, propertyName, state); } } } catch (IllegalAccessException ex) { throw new NoSuchPropertyException(target, propertyName, ex); } return result; }
if ((f == null) || !context.getMemberAccess().isAccessible(context, target, f, propertyName)) { result = NotFound; final Object state = context.getMemberAccess().setup(context, target, f, propertyName); try { result = f.get(target); } finally { context.getMemberAccess().restore(context, target, f, propertyName, state);
public static boolean isFieldAccessible(OgnlContext context, Object target, Field field, String propertyName) { return context.getMemberAccess().isAccessible(context, target, field, propertyName); }
if (context.getMemberAccess().isAccessible(context, null, f, null)) { final Object state = context.getMemberAccess().setup(context, null, f, null); try { result = f.get(null); } finally { context.getMemberAccess().restore(context, null, f, null, state);
public static final boolean isMethodAccessible(OgnlContext context, Object target, Method method, String propertyName) { return (method == null) ? false : context.getMemberAccess().isAccessible(context, target, method, propertyName); }
if (context.getMemberAccess().isAccessible(context, null, f, null)) { final Object state = context.getMemberAccess().setup(context, null, f, null); try { result = f.get(null); } finally { context.getMemberAccess().restore(context, null, f, null, state);
public static boolean isMethodAccessible(OgnlContext context, Object target, Method method, String propertyName) { return (method != null) && context.getMemberAccess().isAccessible(context, target, method, propertyName); }
if ((m == null) || !context.getMemberAccess().isAccessible(context, target, m, propertyName)) { result = NotFound;
if ((m == null) || !context.getMemberAccess().isAccessible(context, target, m, propertyName))
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; }
if ((m == null) || !context.getMemberAccess().isAccessible(context, target, m, propertyName))
if ((m == null) || !context.getMemberAccess().isAccessible(context, target, m, propertyName))
if ((m == null) || !context.getMemberAccess().isAccessible(context, target, m, propertyName))