01: package org.drools.objenesis.instantiator.sun;
02:
03: import org.drools.objenesis.ObjenesisException;
04:
05: /**
06: * Instantiates a class by making a call to internal Sun private methods. It is only supposed to
07: * work on Sun HotSpot 1.3 JVM. This instantiator will not call any constructors.
08: *
09: * @author Leonardo Mesquita
10: * @see org.drools.objenesis.instantiator.ObjectInstantiator
11: */
12: public class Sun13Instantiator extends Sun13InstantiatorBase {
13: public Sun13Instantiator(final Class type) {
14: super (type);
15: }
16:
17: public Object newInstance() {
18: try {
19: return allocateNewObjectMethod.invoke(null, new Object[] {
20: this .type, Object.class });
21: } catch (final Exception e) {
22: throw new ObjenesisException(e);
23: }
24: }
25:
26: }
|