net.sf.juffrou.reflect.internal.DefaultBeanInstanceCreator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of juffrou-reflect Show documentation
Show all versions of juffrou-reflect Show documentation
Performant java bean access through property names. If you are serious about bean handling, this is for you.
package net.sf.juffrou.reflect.internal;
import net.sf.juffrou.reflect.BeanInstanceBuilder;
import net.sf.juffrou.reflect.error.BeanInstanceBuilderException;
public class DefaultBeanInstanceCreator implements BeanInstanceBuilder {
@Override
public Object build(Class clazz) throws BeanInstanceBuilderException {
Object instance;
try {
instance = clazz.newInstance();
} catch (InstantiationException e) {
throw new BeanInstanceBuilderException(e);
} catch (IllegalAccessException e) {
throw new BeanInstanceBuilderException(e);
}
return instance;
}
}