|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The ReflectionSetter
interface is used when
a SecurityManager prevents direct setting of private
field values via Field.setAccessible(boolean). This
is rarely needed as Echo application do not typically
run in a sandbox that restricts Field.setAccessible()
.
If the SecurityManager does not allow accessibility, then this interface is used to delegate the field setting to another class, almosts always the class that actually contains the field.
The helper method set must be implemented in each class in the hierarchy. This is because the security manager will only allow the actual class to set non-public fields, not super-classes.
Field
,
AccessibleObject.setAccessible(boolean).
,
EchoPointComponent.set(Object, String, Object)
Method Summary | |
java.lang.Object |
set(java.lang.reflect.Field field,
java.lang.Object newValue)
Called to save the old value of a field, set in a new value and return the old value of a field. |
Method Detail |
public java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue) throws java.lang.Exception
public Object set(Field f, Object newValue) throws Exception { Object oldValue = f.get(this); f.set(this,newValue); return oldValue; }
field
- - the field to be setnewValue
- - the new value to be set
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.lang.ExceptionInInitializerError
java.lang.Exception
|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |