org.sourceforge.jemm.client
Class Descriptor

java.lang.Object
  extended by org.sourceforge.jemm.client.Descriptor

public class Descriptor
extends java.lang.Object

A descriptor is a method signature that has the following format: className#methodName() Where: methodName - The name of the originating method. - meets the JVM spec for types, ie D for double, F for float, L; for objects - meets the JVM spec for types. The methodParameters and returnValue will work identically to the javap output.

Author:
Paul Keeble

Constructor Summary
Descriptor(java.lang.String signature)
           
Descriptor(java.lang.String className, java.lang.String methodName, java.lang.String signature)
           
Descriptor(java.lang.String className, java.lang.String methodName, java.lang.String returnType, java.lang.String... parameters)
           
 
Method Summary
protected  java.lang.String cleanClassName(java.lang.String aClassName)
          If the passed String starts with L and finishes with ; then the L and the ; is stripped.
 boolean equals(java.lang.Object obj)
           
 java.lang.Class<?> getClassContainingMethod()
           
 java.lang.String getClassName()
           
 java.lang.String getDescriptorString()
           
 java.lang.reflect.Method getMethod()
           
 java.lang.String getMethodName()
           
 java.lang.Class<?>[] getParameterClasses()
           
 java.lang.String[] getParameterStrings()
           
static java.util.Map<java.lang.String,java.lang.Class<?>> getPrimtiveTypesMap()
           
 java.lang.Class<?> getReturnClass()
           
 java.lang.String getReturnString()
           
 java.lang.Class<?> getType(java.lang.String typeName)
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Descriptor

public Descriptor(java.lang.String signature)
           throws DescriptorParsingException
Throws:
DescriptorParsingException

Descriptor

public Descriptor(java.lang.String className,
                  java.lang.String methodName,
                  java.lang.String returnType,
                  java.lang.String... parameters)

Descriptor

public Descriptor(java.lang.String className,
                  java.lang.String methodName,
                  java.lang.String signature)
Method Detail

getClassName

public java.lang.String getClassName()

getClassContainingMethod

public java.lang.Class<?> getClassContainingMethod()
                                            throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

getMethod

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

getMethodName

public java.lang.String getMethodName()

getParameterStrings

public java.lang.String[] getParameterStrings()

getReturnString

public java.lang.String getReturnString()

getReturnClass

public java.lang.Class<?> getReturnClass()
                                  throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

getParameterClasses

public java.lang.Class<?>[] getParameterClasses()
                                         throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

getType

public java.lang.Class<?> getType(java.lang.String typeName)
                           throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

cleanClassName

protected java.lang.String cleanClassName(java.lang.String aClassName)
If the passed String starts with L and finishes with ; then the L and the ; is stripped.

Parameters:
aClassName - The classname to clean.
Returns:
The cleaned class name.

getDescriptorString

public java.lang.String getDescriptorString()

hashCode

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

equals

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

toString

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

getPrimtiveTypesMap

public static java.util.Map<java.lang.String,java.lang.Class<?>> getPrimtiveTypesMap()


Copyright © 2009. All Rights Reserved.