public static Type[] determineTypes(Class[] callbackTypes) { Type[] types = new Type[callbackTypes.length]; for (int i = 0; i < types.length; i++) { types[i] = determineType(callbackTypes[i]); } return types; }
/** * Set the array of callback types to use. * This may be used instead of {@link #setCallbacks} when calling * {@link #createClass}, since it may not be possible to have * an array of actual callback instances. * You must use a {@link CallbackFilter} to specify the index into this * array for each method in the proxied class. * @param callbackTypes the array of callback types */ public void setCallbackTypes(Class[] callbackTypes) { if (callbackTypes != null && callbackTypes.length == 0) { throw new IllegalArgumentException("Array cannot be empty"); } this.callbackTypes = CallbackInfo.determineTypes(callbackTypes); }
public static CallbackGenerator[] getGenerators(Type[] callbackTypes) { CallbackGenerator[] generators = new CallbackGenerator[callbackTypes.length]; for (int i = 0; i < generators.length; i++) { generators[i] = getGenerator(callbackTypes[i]); } return generators; }
private void emitMethods(final ClassEmitter ce, List methods, List actualMethods) { CallbackGenerator[] generators = CallbackInfo.getGenerators(callbackTypes);
private void emitMethods(final ClassEmitter ce, List methods, List actualMethods) { CallbackGenerator[] generators = CallbackInfo.getGenerators(callbackTypes);
public static Type[] determineTypes(Callback[] callbacks) { Type[] types = new Type[callbacks.length]; for (int i = 0; i < types.length; i++) { types[i] = determineType(callbacks[i]); } return types; }
throw new IllegalStateException("Lengths of callback and callback types array must be the same"); Type[] check = CallbackInfo.determineTypes(callbacks); for (int i = 0; i < check.length; i++) { if (!check[i].equals(callbackTypes[i])) { callbackTypes = CallbackInfo.determineTypes(callbacks);
public static CallbackGenerator[] getGenerators(Type[] callbackTypes) { CallbackGenerator[] generators = new CallbackGenerator[callbackTypes.length]; for (int i = 0; i < generators.length; i++) { generators[i] = getGenerator(callbackTypes[i]); } return generators; }
private static Type determineType(Callback callback) { if (callback == null) { throw new IllegalStateException("Callback is null"); } return determineType(callback.getClass()); }
/** * Set the array of callback types to use. * This may be used instead of {@link #setCallbacks} when calling * {@link #createClass}, since it may not be possible to have * an array of actual callback instances. * You must use a {@link CallbackFilter} to specify the index into this * array for each method in the proxied class. * @param callbackTypes the array of callback types */ public void setCallbackTypes(Class[] callbackTypes) { if (callbackTypes != null && callbackTypes.length == 0) { throw new IllegalArgumentException("Array cannot be empty"); } this.callbackTypes = CallbackInfo.determineTypes(callbackTypes); }
public static Type[] determineTypes(Class[] callbackTypes) { Type[] types = new Type[callbackTypes.length]; for (int i = 0; i < types.length; i++) { types[i] = determineType(callbackTypes[i]); } return types; }
throw new IllegalStateException("Lengths of callback and callback types array must be the same"); Type[] check = CallbackInfo.determineTypes(callbacks); for (int i = 0; i < check.length; i++) { if (!check[i].equals(callbackTypes[i])) { callbackTypes = CallbackInfo.determineTypes(callbacks);
public static Type[] determineTypes(Callback[] callbacks) { Type[] types = new Type[callbacks.length]; for (int i = 0; i < types.length; i++) { types[i] = determineType(callbacks[i]); } return types; }
private static Type determineType(Callback callback) { if (callback == null) { throw new IllegalStateException("Callback is null"); } return determineType(callback.getClass()); }