
com.fluentinterface.proxy.internal.EmptyConstructor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fluent-interface-proxy Show documentation
Show all versions of fluent-interface-proxy Show documentation
A dynamic proxy that implements builder interfaces transparently.
The newest version!
package com.fluentinterface.proxy.internal;
import com.fluentinterface.proxy.BuilderState;
import com.fluentinterface.proxy.Instantiator;
/**
* Instantiates an object using its default empty constructor.
*/
class EmptyConstructor implements Instantiator {
private Class targetClass;
EmptyConstructor(Class targetClass) {
this.targetClass = targetClass;
}
@Override
public T instantiate(BuilderState state) throws InstantiationException {
try {
return targetClass.newInstance();
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy