01: package org.drools.objenesis.instantiator.basic;
02:
03: /**
04: * Instantiates a class by grabbing the no-args constructor, making it accessible and then calling
05: * Constructor.newInstance(). Although this still requires no-arg constructors, it can call
06: * non-public constructors (if the security manager allows it).
07: *
08: * @see org.drools.objenesis.instantiator.ObjectInstantiator
09: */
10: public class AccessibleInstantiator extends ConstructorInstantiator {
11:
12: public AccessibleInstantiator(final Class type) {
13: super (type);
14: if (this .constructor != null) {
15: this .constructor.setAccessible(true);
16: }
17: }
18: }
|