public Field getField(Class inClass, String name) { return OgnlRuntime.getField(inClass, name); }
final Field f = getField((target == null) ? null : target.getClass(), propertyName);
public static final boolean hasField(OgnlContext context, Object target, Class inClass, String propertyName) { Field f = getField(inClass, propertyName); return (f != null) && isFieldAccessible(context, target, f, propertyName); }
final Field f = getField((target == null) ? null : target.getClass(), propertyName);
public static boolean isFieldAccessible(OgnlContext context, Object target, Class inClass, String propertyName) { return isFieldAccessible(context, target, getField(inClass, propertyName), propertyName); }
public static boolean hasField(OgnlContext context, Object target, Class inClass, String propertyName) { Field f = getField(inClass, propertyName); return (f != null) && isFieldAccessible(context, target, f, propertyName); }
public static boolean hasField(OgnlContext context, Object target, Class inClass, String propertyName) { Field f = getField(inClass, propertyName); return (f != null) && isFieldAccessible(context, target, f, propertyName); }
public static final boolean isFieldAccessible(OgnlContext context, Object target, Class inClass, String propertyName) { return isFieldAccessible(context, target, getField(inClass, propertyName), propertyName); }
public static boolean isFieldAccessible(OgnlContext context, Object target, Class inClass, String propertyName) { return isFieldAccessible(context, target, getField(inClass, propertyName), 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; }
} else Field f = OgnlRuntime.getField(c, fieldName); if (f == null) { throw new NoSuchFieldException(fieldName);
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; }
} else Field f = OgnlRuntime.getField(c, fieldName); if (f == null) { throw new NoSuchFieldException(fieldName);
public static final Object getFieldValue(OgnlContext context, Object target, String propertyName, boolean checkAccessAndExistence) throws NoSuchFieldException Field f = getField((target == null) ? null : target.getClass(), 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; }
final Field f = getField(c, fieldName); if (f == null) { throw new NoSuchFieldException(fieldName);
final Field f = getField(c, fieldName); if (f == null) { throw new NoSuchFieldException(fieldName);