Class OObjectProxyMethodHandler
java.lang.Object
com.orientechnologies.orient.object.enhancement.OObjectProxyMethodHandler
- All Implemented Interfaces:
javassist.util.proxy.MethodHandler
- Author:
- Luca Molino (molino.luca--at--gmail.com)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidMethod that attaches all data contained in the object to the associated documentprotected voidconvertArray(Object[] value, Object[] newValue, boolean isEnum) protected ObjectconvertDocumentToObject(ODocument value, Object self) voidMethod that detaches all fields contained in the document to the given objectvoiddetachAll(Object self, boolean nonProxiedInstance, Map<Object, Object> alreadyDetached, Map<Object, Object> lazyObjects) Method that detaches all fields contained in the document to the given objectgetDoc()protected ObjectgetDocFieldValue(Object self, String fieldName) javassist.util.proxy.ProxyObjectprotected MethodgetSetMethod(Class<?> iClass, String fieldName, Object value) protected StringgetSetterFieldName(String fieldName) protected Objectprotected ObjectgetValue(Object self, String fieldName, boolean idOrVersionField, Object value, boolean iIgnoreLoadedFields) protected ObjectlazyLoadField(Object self, String fieldName, Object docValue, Object currentValue) protected ObjectmanageArrayFieldObject(Field field, Object self, Object value) protected ObjectmanageArrayLoad(Object value, Field f) protected ObjectmanageArraySave(String iFieldName, Object[] value) protected ObjectmanageCollectionLoad(Field f, Object self, Object value, boolean customSerialization) protected ObjectmanageCollectionSave(Object self, Field f, Collection<?> value, boolean customSerialization, boolean isFieldUpdate) protected ObjectmanageEnumCollections(Object self, String fieldName, Class<?> enumClass, Object value) protected ObjectmanageGetMethod(Object self, Method m, Method proceed, Object[] args) protected ObjectmanageMapLoad(Field f, Object self, Object value, boolean customSerialization) protected ObjectmanageMapSave(Object self, Field f, Map<?, ?> value, boolean customSerialization) protected ObjectmanageObjectCollections(Object self, String fieldName, Object value) protected ObjectmanageSerializedCollections(Object self, String fieldName, Object value) protected ObjectmanageSetMethod(Object self, Method m, Method proceed, Object[] args) voidsetDirty()voidprotected ObjectsetDocFieldValue(String fieldName, Object value, OType type) voidsetParentObject(javassist.util.proxy.ProxyObject parentDoc) protected ObjectvoidupdateLoadedFieldMap(Object proxiedObject, boolean iReload)
-
Field Details
-
loadedFields
-
orphans
-
doc
-
parentObject
protected javassist.util.proxy.ProxyObject parentObject -
reading
protected boolean reading
-
-
Constructor Details
-
OObjectProxyMethodHandler
-
-
Method Details
-
getDoc
-
setDoc
-
getParentObject
public javassist.util.proxy.ProxyObject getParentObject() -
setParentObject
public void setParentObject(javassist.util.proxy.ProxyObject parentDoc) -
getOrphans
-
invoke
- Specified by:
invokein interfacejavassist.util.proxy.MethodHandler- Throws:
Throwable
-
detach
public void detach(Object self, boolean nonProxiedInstance) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException Method that detaches all fields contained in the document to the given object- Parameters:
self- :- The object containing this handler instance- Throws:
InvocationTargetExceptionIllegalAccessExceptionNoSuchMethodException
-
detachAll
public void detachAll(Object self, boolean nonProxiedInstance, Map<Object, Object> alreadyDetached, Map<Object, throws NoSuchMethodException, IllegalAccessException, InvocationTargetExceptionObject> lazyObjects) Method that detaches all fields contained in the document to the given object- Parameters:
self- :- The object containing this handler instance- Throws:
InvocationTargetExceptionIllegalAccessExceptionNoSuchMethodException
-
attach
public void attach(Object self) throws IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException Method that attaches all data contained in the object to the associated document- Parameters:
self- :- The object containing this handler instance- Throws:
IllegalAccessExceptionIllegalArgumentExceptionInvocationTargetExceptionNoSuchMethodException
-
setDirty
public void setDirty() -
updateLoadedFieldMap
-
manageGetMethod
protected Object manageGetMethod(Object self, Method m, Method proceed, Object[] args) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException, SecurityException, IllegalArgumentException, NoSuchFieldException -
getValue
protected Object getValue(Object self, String fieldName, boolean idOrVersionField, Object value) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException -
getValue
protected Object getValue(Object self, String fieldName, boolean idOrVersionField, Object value, boolean iIgnoreLoadedFields) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException -
getDocFieldValue
-
setDocFieldValue
-
manageObjectCollections
protected Object manageObjectCollections(Object self, String fieldName, Object value) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException -
manageSerializedCollections
protected Object manageSerializedCollections(Object self, String fieldName, Object value) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException -
manageEnumCollections
protected Object manageEnumCollections(Object self, String fieldName, Class<?> enumClass, Object value) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException -
manageArraySave
-
convertArray
-
manageMapSave
-
manageCollectionSave
protected Object manageCollectionSave(Object self, Field f, Collection<?> value, boolean customSerialization, boolean isFieldUpdate) -
lazyLoadField
protected Object lazyLoadField(Object self, String fieldName, Object docValue, Object currentValue) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException -
manageArrayLoad
-
manageMapLoad
-
manageCollectionLoad
-
manageArrayFieldObject
-
convertDocumentToObject
-
manageSetMethod
protected Object manageSetMethod(Object self, Method m, Method proceed, Object[] args) throws IllegalAccessException, InvocationTargetException -
setValue
-
getSetterFieldName
-
getSetMethod
protected Method getSetMethod(Class<?> iClass, String fieldName, Object value) throws NoSuchMethodException - Throws:
NoSuchMethodException
-