public Object getProperty(Map context, Object target, Object oname) throws OgnlException { Object result = null; String name = oname.toString(); result = getPossibleProperty(context, target, name); if (result == OgnlRuntime.NotFound) { throw new NoSuchPropertyException(target, name); } return result; }
public void setProperty( Map context, Object target, Object oname, Object value ) throws OgnlException { String name = oname.toString(); if (setPossibleProperty(context, target, name, value) == OgnlRuntime.NotFound) { throw new NoSuchPropertyException(target, name); } } }
public void setProperty(Map context, Object target, Object oname, Object value) throws OgnlException { String name = oname.toString(); Object result = setPossibleProperty(context, target, name, value); if (result == OgnlRuntime.NotFound) { throw new NoSuchPropertyException(target, name); } }
public Object getProperty( Map context, Object target, Object oname ) throws OgnlException { Object result = null; String name = oname.toString(); if ((result = getPossibleProperty(context, target, name)) == OgnlRuntime.NotFound) { throw new NoSuchPropertyException(target, name); } return result; }
public void setProperty(Map context, Object target, Object oname, Object value) throws OgnlException { String name = oname.toString(); Object result = setPossibleProperty(context, target, name, value); if (result == OgnlRuntime.NotFound) { throw new NoSuchPropertyException(target, name); } }
public Object getProperty(Map context, Object target, Object oname) throws OgnlException { Object result = null; String name = oname.toString(); result = getPossibleProperty(context, target, name); if (result == OgnlRuntime.NotFound) { throw new NoSuchPropertyException(target, name); } return result; }
public Object getProperty( Map context, Object target, Object name ) throws OgnlException { Set set = (Set)target; if ( name instanceof String ) { Object result; if (name.equals("size")) { result = new Integer(set.size()); } else { if (name.equals("iterator")) { result = set.iterator(); } else { if (name.equals("isEmpty")) { result = set.isEmpty() ? Boolean.TRUE : Boolean.FALSE; } else { result = super.getProperty( context, target, name ); } } } return result; } throw new NoSuchPropertyException( target, name ); }
public Object getProperty( Map context, Object target, Object name ) throws OgnlException { Set set = (Set)target; if ( name instanceof String ) { Object result; if (name.equals("size")) { result = new Integer(set.size()); } else { if (name.equals("iterator")) { result = set.iterator(); } else { if (name.equals("isEmpty")) { result = set.isEmpty() ? Boolean.TRUE : Boolean.FALSE; } else { result = super.getProperty( context, target, name ); } } } return result; } throw new NoSuchPropertyException( target, name ); }
public Object getProperty( Map context, Object target, Object name ) throws OgnlException { Set set = (Set)target; if ( name instanceof String ) { Object result; if (name.equals("size")) { result = new Integer(set.size()); } else { if (name.equals("iterator")) { result = set.iterator(); } else { if (name.equals("isEmpty")) { result = set.isEmpty() ? Boolean.TRUE : Boolean.FALSE; } else { result = super.getProperty( context, target, name ); } } } return result; } throw new NoSuchPropertyException( target, name ); } }
throw new NoSuchPropertyException(target, name);
throw new NoSuchPropertyException( target, name );
throw new NoSuchPropertyException(target, index);
throw new NoSuchPropertyException(target, name);
throw new NoSuchPropertyException( target, name );
throw new NoSuchPropertyException(target, name);
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 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 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; }
@Override public Object getProperty( Object target, Object name ) throws OgnlException { if ( name instanceof String ) return super.getProperty(target, name); NSArray array = (NSArray)target; if ( name instanceof Number ) { return array.objectAtIndex(((Number)name).intValue()); } if ( name instanceof DynamicSubscript ) { int len = array.count(); switch (((DynamicSubscript)name).getFlag()) { case DynamicSubscript.FIRST: return len > 0 ? array.objectAtIndex(0) : null; case DynamicSubscript.MID: return len > 0 ? array.objectAtIndex(len/2) : null; case DynamicSubscript.LAST: return len > 0 ? array.lastObject() : null; case DynamicSubscript.ALL: return array.clone(); } } throw new NoSuchPropertyException(target, name); }
@Override public void setProperty(Object target, Object name, Object value) throws OgnlException { if (name instanceof String ) { super.setProperty(target, name, value); return; } NSMutableArray array = (NSMutableArray)target; if (name instanceof Number ) { array.replaceObjectAtIndex(value, ((Number)name).intValue()); return; } if ( name instanceof DynamicSubscript ) { int len = array.count(); switch ( ((DynamicSubscript)name).getFlag() ) { case DynamicSubscript.FIRST: if ( len > 0 ) array.replaceObjectAtIndex(value, 0); return; case DynamicSubscript.MID: if ( len > 0 ) array.replaceObjectAtIndex(value, len/2); return; case DynamicSubscript.LAST: if ( len > 0 ) array.replaceObjectAtIndex(value, len-1); return; case DynamicSubscript.ALL: array.setArray( NSPropertyListSerialization.arrayForString( (String) value ) ); return; } } throw new NoSuchPropertyException( target, name ); } }