/** * mixin interface and delegates. * all class must be public. * * @param ics interface class array. * @param dc delegate class. * @return Mixin instance. */ public static Mixin mixin(Class<?>[] ics, Class<?> dc) { return mixin(ics, new Class[]{dc}); }
@Override protected Object doInvoke(T proxy, String methodName, Class<?>[] parameterTypes, Object[] arguments) throws Throwable { return wrapper.invokeMethod(proxy, methodName, parameterTypes, arguments); } };
/** * get instance with special handler. * * @return instance. */ abstract public Object newInstance(InvocationHandler handler); }
/** * get property value. * * @param instance instance. * @param pns property name array. * @return value array. */ public Object[] getPropertyValues(Object instance, String[] pns) throws NoSuchPropertyException, IllegalArgumentException { Object[] ret = new Object[pns.length]; for (int i = 0; i < ret.length; i++) ret[i] = getPropertyValue(instance, pns[i]); return ret; }
@Override public Object getPropertyValue(Object instance, String pn) throws NoSuchPropertyException { throw new NoSuchPropertyException("Property [" + pn + "] not found."); }
public ClassGenerator addMethod(String name, int mod, Class<?> rt, Class<?>[] pts, String body) { return addMethod(name, mod, rt, pts, null, body); }
/** * get instance with special handler. * * @return instance. */ abstract public Object newInstance(InvocationHandler handler); }
/** * mixin interface and delegates. * all class must be public. * * @param ics interface class array. * @param dc delegate class. * @return Mixin instance. */ public static Mixin mixin(Class<?>[] ics, Class<?> dc) { return mixin(ics, new Class[]{dc}); }
@Override protected Object doInvoke(T proxy, String methodName, Class<?>[] parameterTypes, Object[] arguments) throws Throwable { return wrapper.invokeMethod(proxy, methodName, parameterTypes, arguments); } };
/** * get property value. * * @param instance instance. * @param pns property name array. * @return value array. */ public Object[] getPropertyValues(Object instance, String[] pns) throws NoSuchPropertyException, IllegalArgumentException { Object[] ret = new Object[pns.length]; for (int i = 0; i < ret.length; i++) ret[i] = getPropertyValue(instance, pns[i]); return ret; }
@Override public void setPropertyValue(Object instance, String pn, Object pv) throws NoSuchPropertyException { throw new NoSuchPropertyException("Property [" + pn + "] not found."); }
/** * get instance with special handler. * * @return instance. */ abstract public Object newInstance(InvocationHandler handler);
/** * mixin interface and delegates. * all class must be public. * * @param ics interface class array. * @param dc delegate class. * @param cl class loader. * @return Mixin instance. */ public static Mixin mixin(Class<?>[] ics, Class<?> dc, ClassLoader cl) { return mixin(ics, new Class[]{dc}, cl); }
@Override protected Object doInvoke(T proxy, String methodName, Class<?>[] parameterTypes, Object[] arguments) throws Throwable { return wrapper.invokeMethod(proxy, methodName, parameterTypes, arguments); } };
/** * get instance with special handler. * * @return instance. */ abstract public Object newInstance(InvocationHandler handler);
/** * mixin interface and delegates. * all class must be public. * * @param ics interface class array. * @param dc delegate class. * @return Mixin instance. */ public static Mixin mixin(Class<?>[] ics, Class<?> dc) { return mixin(ics, new Class[]{dc}); }
@Override protected Object doInvoke(T proxy, String methodName, Class<?>[] parameterTypes, Object[] arguments) throws Throwable { return wrapper.invokeMethod(proxy, methodName, parameterTypes, arguments); } };
/** * mixin interface and delegates. * all class must be public. * * @param ics interface class array. * @param dc delegate class. * @return Mixin instance. */ public static Mixin mixin(Class<?>[] ics, Class<?> dc) { return mixin(ics, new Class[]{dc}); }
/** * mixin interface and delegates. * all class must be public. * * @param ics interface class array. * @param dc delegate class. * @param cl class loader. * @return Mixin instance. */ public static Mixin mixin(Class<?>[] ics, Class<?> dc, ClassLoader cl) { return mixin(ics, new Class[]{dc}, cl); }
/** * mixin interface and delegates. * all class must be public. * * @param ics interface class array. * @param dc delegate class. * @param cl class loader. * @return Mixin instance. */ public static Mixin mixin(Class<?>[] ics, Class<?> dc, ClassLoader cl) { return mixin(ics, new Class[]{dc}, cl); }