|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.runtime.MethodRankHelper
public class MethodRankHelper
Utility class for MissingMethodException, MissingProperyException etc. This class contains methods assisting in ranking and listing probable intended methods/fields when a exception is thrown.
Field Summary | |
---|---|
static int |
DL_CASE
|
static int |
DL_DELETE
|
static int |
DL_SUBSTITUTION
|
static int |
DL_TRANSPOSITION
|
static int |
MAX_CONSTRUCTOR_SCORE
|
static int |
MAX_FIELD_SCORE
|
static int |
MAX_METHOD_SCORE
|
static int |
MAX_RECOMENDATIONS
|
Constructor Summary | |
---|---|
MethodRankHelper()
|
Method Summary | |
---|---|
protected static Class |
boxVar(Class c)
If c is a primitive class this method returns a boxed version otherwise c is returned. |
static int |
damerauLevenshteinDistance(Object[] s,
Object[] t)
This is a implementation of DL distance between two Object arrays instead of character streams. |
static int |
delDistance(CharSequence s,
CharSequence t)
This is a slightly modified version of the Damerau Levenshtein distance algorithm. |
static String |
getConstructorSuggestionString(Class type,
Object[] arguments)
Returns a string detailing possible solutions to a missing constructor if no good solutions can be found a empty string is returned. |
static String |
getMethodSuggestionString(String methodName,
Class type,
Object[] arguments)
Returns a string detailing possible solutions to a missing method if no good solutions can be found a empty string is returned. |
static String |
getPropertySuggestionString(String fieldName,
Class type)
Returns a string detailing possible solutions to a missning field or property if no good solutions can be found a empty string is returned. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DL_SUBSTITUTION
public static final int DL_DELETE
public static final int DL_TRANSPOSITION
public static final int DL_CASE
public static final int MAX_RECOMENDATIONS
public static final int MAX_METHOD_SCORE
public static final int MAX_CONSTRUCTOR_SCORE
public static final int MAX_FIELD_SCORE
Constructor Detail |
---|
public MethodRankHelper()
Method Detail |
---|
public static String getMethodSuggestionString(String methodName, Class type, Object[] arguments)
methodName
- the name of the method that doesn't existtype
- the class on which the method is invokedarguments
- the arguments passed to the method
public static String getConstructorSuggestionString(Class type, Object[] arguments)
arguments
- the arguments passed to the constructortype
- the class on which the constructor is invoked
public static String getPropertySuggestionString(String fieldName, Class type)
fieldname
- the missing fieldtype
- the class on which the field is sought
protected static Class boxVar(Class c)
c
-
public static int delDistance(CharSequence s, CharSequence t)
s
- a CharSequencet
- the CharSequence to be compared to s
public static int damerauLevenshteinDistance(Object[] s, Object[] t)
s
- a Object arrayt
- this array is compared to s
|
Copyright © 2003-2009 The Codehaus. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |