com.liferay.portal.kernel.util
Class MethodKey

java.lang.Object
  extended by com.liferay.portal.kernel.util.MethodKey
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class MethodKey
extends java.lang.Object
implements java.io.Externalizable

Provides a serializable loose representation for Method, considering the declaring class, name, and parameter types of the Method, while ignoring its return type and exceptions. This means the compiler generated bridging method is considered logically the same as it source counterpart. On deserialization for a generic Method, the Method that is resolved (bridge method or source method) is runtime environment dependent. Whether it is resolved to a bridge method or source method is of no consequence, as a force cast is performed on the method's return value, assuring the same result.

Author:
Brian Wing Shun Chan, Shuyang Zhou
See Also:
Serialized Form

Constructor Summary
MethodKey()
          The empty constructor is required by Externalizable.
MethodKey(java.lang.Class<?> declaringClass, java.lang.String methodName, java.lang.Class<?>... parameterTypes)
           
MethodKey(java.lang.reflect.Method method)
           
MethodKey(java.lang.String declaringClassName, java.lang.String methodName, java.lang.Class<?>... parameterTypes)
          Deprecated. As of 6.2.0, replaced by MethodKey(Class, String, Class...)
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Class<?> getDeclaringClass()
           
 java.lang.reflect.Method getMethod()
           
 java.lang.String getMethodName()
           
 java.lang.Class<?>[] getParameterTypes()
           
 int hashCode()
           
 void readExternal(java.io.ObjectInput objectInput)
           
 java.lang.String toString()
           
 MethodKey transform(java.lang.ClassLoader classLoader)
           
 void writeExternal(java.io.ObjectOutput objectOutput)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodKey

public MethodKey()
The empty constructor is required by Externalizable. Do not use this for any other purpose.


MethodKey

public MethodKey(java.lang.Class<?> declaringClass,
                 java.lang.String methodName,
                 java.lang.Class<?>... parameterTypes)

MethodKey

public MethodKey(java.lang.reflect.Method method)

MethodKey

public MethodKey(java.lang.String declaringClassName,
                 java.lang.String methodName,
                 java.lang.Class<?>... parameterTypes)
Deprecated. As of 6.2.0, replaced by MethodKey(Class, String, Class...)

Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getDeclaringClass

public java.lang.Class<?> getDeclaringClass()

getMethod

public java.lang.reflect.Method getMethod()
                                   throws java.lang.NoSuchMethodException
Throws:
java.lang.NoSuchMethodException

getMethodName

public java.lang.String getMethodName()

getParameterTypes

public java.lang.Class<?>[] getParameterTypes()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

readExternal

public void readExternal(java.io.ObjectInput objectInput)
                  throws java.lang.ClassNotFoundException,
                         java.io.IOException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.lang.ClassNotFoundException
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

transform

public MethodKey transform(java.lang.ClassLoader classLoader)
                    throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput objectOutput)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException