com.futureshocked.classloader
Class MethodDescriptionUtil

java.lang.Object
  extended by com.futureshocked.classloader.MethodDescriptionUtil

public class MethodDescriptionUtil
extends java.lang.Object

Small utility class that will parse a code style method declaration and populate instance variables with the class name, method, and description.

This is useful for generating the appropriate description, without having to know the correct format.


Field Summary
private  java.lang.String description
          The method description.
private  java.lang.String fullClassName
          The full class name, including pacakge.
private  java.lang.String method
          The name of the method.
private static java.util.HashMap types
          HashMap that maps code style tpyes to description types
 
Constructor Summary
MethodDescriptionUtil(java.lang.String codeStyleMethod)
          Constructor that populates the instance variables based on the code style method declaration given in the constructor.
 
Method Summary
 java.lang.String getClassName()
           
 java.lang.String getDescription()
           
 java.lang.String getMethodName()
           
 java.lang.String getTypeDescriptor(java.lang.String type)
          Given a code style type, returns a description style type.
 void parseCodeStyleMethod(java.lang.String code)
          Parses a code style method declaration, and populates the instance variables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

types

private static java.util.HashMap types
HashMap that maps code style tpyes to description types


fullClassName

private java.lang.String fullClassName
The full class name, including pacakge.


method

private java.lang.String method
The name of the method.


description

private java.lang.String description
The method description.

Constructor Detail

MethodDescriptionUtil

public MethodDescriptionUtil(java.lang.String codeStyleMethod)
Constructor that populates the instance variables based on the code style method declaration given in the constructor.

Example method declaration:
java.lang.String com.user.package.Class.testMethod(int arg1);

Parameters:
codeStyleMethod - A method declaration
Method Detail

parseCodeStyleMethod

public void parseCodeStyleMethod(java.lang.String code)
Parses a code style method declaration, and populates the instance variables.

Parameters:
code - A method declaration

getTypeDescriptor

public java.lang.String getTypeDescriptor(java.lang.String type)
Given a code style type, returns a description style type.

Parameters:
type - A type as would be declared in Java source code - ie: int, char, float, java.lang.String, etc.
Returns:
The type as needed in descriptions.

getClassName

public java.lang.String getClassName()

getMethodName

public java.lang.String getMethodName()

getDescription

public java.lang.String getDescription()