Methods Summary |
---|
public java.lang.Class | getDeclaringClass()
return getMethod().getDeclaringClass();
|
protected java.lang.reflect.Method | getMethod()
return getAccessibleObject();
|
public java.lang.String | getName()
if(name == null)
{
String name = getMethod().getName().substring(3);
if (name.length() > 1)
{
name = name.substring(0, 1).toLowerCase() + name.substring(1);
}
else
{
name = name.toLowerCase();
}
this.name = name; // atomair, no synch
}
return name;
|
public java.lang.Class | getType()
return getMethod().getParameterTypes()[0];
|
public void | set(java.lang.Object instance, java.lang.Object value)
Method method = getMethod();
Object args[] = { value };
try
{
method.invoke(instance, args);
}
catch (IllegalAccessException e)
{
log.fatal("illegal access on method " + method, e);
throw new RuntimeException(e);
}
catch (IllegalArgumentException e)
{
String msg = "failed to set value " + value + " with setter " + method;
log.error(msg, e);
throw new IllegalArgumentException(msg);
}
catch (InvocationTargetException e)
{
Throwable cause = e.getCause();
if(cause instanceof Error)
throw (Error) cause;
if(cause instanceof RuntimeException)
throw (RuntimeException) cause;
throw new RuntimeException(cause);
}
|