@Override public <T> PlasticClassTransformation<T> createProxyTransformation(Class<T> interfaceType, Class<? extends T> implementationType) { return manager.createProxyTransformation(interfaceType, implementationType); }
/** * Creates an entirely new class. The class extends from Object and implements the provided interface. * * @param interfaceType * class to extend from, which must be a class, not an interface * @param implementationType * class that implements interfaceType. It can be null. * @param callback * used to configure the new class * @return the instantiator, which allows instances of the new class to be created * @see #createProxyTransformation(Class, Class) * @since 5.4 */ public <T> ClassInstantiator<T> createProxy(Class<T> interfaceType, Class<? extends T> implementationType, PlasticClassTransformer callback) { assert callback != null; PlasticClassTransformation<T> transformation = createProxyTransformation(interfaceType, implementationType); callback.transform(transformation.getPlasticClass()); return transformation.createInstantiator(); }
/** * Creates an entirely new class. The class extends from Object and implements the provided interface. * * @param interfaceType * class to extend from, which must be a class, not an interface * @param implementationType * class that implements interfaceType. It can be null. * @param callback * used to configure the new class * @return the instantiator, which allows instances of the new class to be created * @see #createProxyTransformation(Class, Class) * @since 5.4 */ public <T> ClassInstantiator<T> createProxy(Class<T> interfaceType, Class<? extends T> implementationType, PlasticClassTransformer callback) { assert callback != null; PlasticClassTransformation<T> transformation = createProxyTransformation(interfaceType, implementationType); callback.transform(transformation.getPlasticClass()); return transformation.createInstantiator(); }