Cumulus4j API
(1.1.1)

org.cumulus4j.store.reflectionwrapper
Class ReflectionWrapper

java.lang.Object
  extended by org.cumulus4j.store.reflectionwrapper.ReflectionWrapper
Direct Known Subclasses:
Key, KeyFactory

public abstract class ReflectionWrapper
extends Object


Constructor Summary
ReflectionWrapper(ClassLoader classLoader)
           
ReflectionWrapper(ReflectionWrapper persistenceEngineWrapper, Object wrappedObject)
           
 
Method Summary
protected  Object createWrappedObject(Class<?> wrappedClass)
           
protected  ClassLoader getClassLoader()
           
 Class<?> getWrappedClass()
           
protected  String getWrappedClassName()
           
 Object getWrappedObject()
           
protected  Object invoke(int methodID, String methodName)
          Invoke a method on the wrapped object.
protected  Object invoke(int methodID, String methodName, Class<?>[] parameterTypes, Object... parameters)
          Invoke a method on the wrapped object.
protected  Object invoke(int methodID, String methodName, Class<?> parameterType1, Class<?> parameterType2, Class<?> parameterType3, Object... parameters)
          Invoke a method on the wrapped object.
protected  Object invoke(int methodID, String methodName, Class<?> parameterType1, Class<?> parameterType2, Object... parameters)
          Invoke a method on the wrapped object.
protected  Object invoke(int methodID, String methodName, Class<?> parameterType, Object parameter)
          Invoke a method on the wrapped object.
protected  Object invokeStatic(int methodID, String methodName)
           
protected  Object invokeStatic(int methodID, String methodName, Class<?>[] parameterTypes, Object... parameters)
          Invoke a method on the wrapped class (not the wrapped object) in a static way.
protected  Object invokeStatic(int methodID, String methodName, Class<?> parameterType1, Class<?> parameterType2, Class<?> parameterType3, Object... parameters)
           
protected  Object invokeStatic(int methodID, String methodName, Class<?> parameterType1, Class<?> parameterType2, Object... parameters)
           
protected  Object invokeStatic(int methodID, String methodName, Class<?> parameterType, Object parameter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionWrapper

public ReflectionWrapper(ClassLoader classLoader)

ReflectionWrapper

public ReflectionWrapper(ReflectionWrapper persistenceEngineWrapper,
                         Object wrappedObject)
Method Detail

getClassLoader

protected ClassLoader getClassLoader()

getWrappedClassName

protected String getWrappedClassName()

getWrappedClass

public Class<?> getWrappedClass()

createWrappedObject

protected Object createWrappedObject(Class<?> wrappedClass)

getWrappedObject

public Object getWrappedObject()

invokeStatic

protected Object invokeStatic(int methodID,
                              String methodName)

invokeStatic

protected Object invokeStatic(int methodID,
                              String methodName,
                              Class<?> parameterType,
                              Object parameter)

invokeStatic

protected Object invokeStatic(int methodID,
                              String methodName,
                              Class<?> parameterType1,
                              Class<?> parameterType2,
                              Object... parameters)

invokeStatic

protected Object invokeStatic(int methodID,
                              String methodName,
                              Class<?> parameterType1,
                              Class<?> parameterType2,
                              Class<?> parameterType3,
                              Object... parameters)

invokeStatic

protected Object invokeStatic(int methodID,
                              String methodName,
                              Class<?>[] parameterTypes,
                              Object... parameters)
Invoke a method on the wrapped class (not the wrapped object) in a static way.

Parameters:
methodID - identifier that must be unique within the subclass of ReflectionWrapper. For performance reasons, the Method instances are cached and the cache key is this methodID (rather than a long String comprising methodName and parameterTypes).
methodName - method name as passed to Class.getMethod(String, Class...).
parameterTypes - parameter types as passed to Class.getMethod(String, Class...).
parameters - parameters as passed to Method.invoke(Object, Object...).
Returns:
the result of the method invocation as returned from Method.invoke(Object, Object...).

invoke

protected Object invoke(int methodID,
                        String methodName)
Invoke a method on the wrapped object. This is a convenience method delegating to invoke(int, String, Class[], Object...).

Parameters:
methodID - identifier that must be unique within the subclass of ReflectionWrapper.
methodName - method name.
Returns:
the result of the method invocation.

invoke

protected Object invoke(int methodID,
                        String methodName,
                        Class<?> parameterType,
                        Object parameter)
Invoke a method on the wrapped object. This is a convenience method delegating to invoke(int, String, Class[], Object...).

Parameters:
methodID - identifier that must be unique within the subclass of ReflectionWrapper.
methodName - method name.
parameterType - single parameter type.
parameter - single parameter.
Returns:
the result of the method invocation.

invoke

protected Object invoke(int methodID,
                        String methodName,
                        Class<?> parameterType1,
                        Class<?> parameterType2,
                        Object... parameters)
Invoke a method on the wrapped object. This is a convenience method delegating to invoke(int, String, Class[], Object...).

Parameters:
methodID - identifier that must be unique within the subclass of ReflectionWrapper.
methodName - method name.
parameterType1 - first parameter type.
parameterType2 - second parameter type.
parameters - two parameters (corresponding to the two parameter types).
Returns:
the result of the method invocation.

invoke

protected Object invoke(int methodID,
                        String methodName,
                        Class<?> parameterType1,
                        Class<?> parameterType2,
                        Class<?> parameterType3,
                        Object... parameters)
Invoke a method on the wrapped object. This is a convenience method delegating to invoke(int, String, Class[], Object...).

Parameters:
methodID - identifier that must be unique within the subclass of ReflectionWrapper.
methodName - method name.
parameterType1 - first parameter type.
parameterType2 - second parameter type.
parameterType3 - third parameter type.
parameters - three parameters (corresponding to the three parameter types).
Returns:
the result of the method invocation.

invoke

protected Object invoke(int methodID,
                        String methodName,
                        Class<?>[] parameterTypes,
                        Object... parameters)
Invoke a method on the wrapped object.

Parameters:
methodID - identifier that must be unique within the subclass of ReflectionWrapper. For performance reasons, the Method instances are cached and the cache key is this methodID (rather than a long String comprising methodName and parameterTypes).
methodName - method name as passed to Class.getMethod(String, Class...).
parameterTypes - parameter types as passed to Class.getMethod(String, Class...).
parameters - parameters as passed to Method.invoke(Object, Object...).
Returns:
the result of the method invocation as returned from Method.invoke(Object, Object...).

Cumulus4j API
(1.1.1)

Copyright © 2013 NightLabs Consulting GmbH. All Rights Reserved.