org.julp
Class CGLibInstantiator<T>
java.lang.Object
org.julp.CGLibInstantiator<T>
- All Implemented Interfaces:
- java.io.Serializable, Instantiator<T>
public class CGLibInstantiator<T>
- extends java.lang.Object
- implements Instantiator<T>
CGLibInstantiator instantiates class and enhances it to make it persistable.
Also it can enhanced already instantiated class.
Keep in mind the class name of instantiated or enhanced object will be different.
In fact it will be descendant (inherited) from the passed class/object.
It will be like this: [Your class name]$$EnhancerByCGLIB$$[some alphanumeric]
i.e. Customer$$EnhancerByCGLIB$$d8f6a6bd. If you need access original class
you can use method public Class> getOriginalClass();
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
abstractDomainObjectMethods
private static java.util.Map<java.lang.String,java.lang.reflect.Method> abstractDomainObjectMethods
abstractDomainObjectMethodsToSkip
private java.util.Set<java.lang.String> abstractDomainObjectMethodsToSkip
- Execute methods of superclass rather then AbstractDomainObject methods if they have the same names
EMPTY_ARG
private static final java.lang.Object[] EMPTY_ARG
instanceMethods
private java.lang.reflect.Method[] instanceMethods
CGLibInstantiator
public CGLibInstantiator()
CGLibInstantiator
public CGLibInstantiator(java.util.Set<java.lang.String> abstractDomainObjectMethodsToSkip)
getAbstractDomainObjectMethodsToSkip
public java.util.Set<java.lang.String> getAbstractDomainObjectMethodsToSkip()
setAbstractDomainObjectMethodsToSkip
public void setAbstractDomainObjectMethodsToSkip(java.util.Set<java.lang.String> methodsToSkip)
init
private void init()
getInstanceMethod
private java.lang.reflect.Method getInstanceMethod(java.lang.String methodName)
newInstance
public T newInstance(java.lang.Class domainClass)
- Specified by:
newInstance in interface Instantiator<T>
enhance
public T enhance(T instance)
- Specified by:
enhance in interface Instantiator<T>
process
protected T process(java.lang.Class domainClass,
T instance)