|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.jam.JamUtils
public class JamUtils
Singleton collection of utility methods which can be very useful in some samples, but not often enough to warrant inclusion in the main APIs.
Most of these are here to help you jump from the JClass hierarchy to the java.lang.reflect hierarchy. This is primarily useful when you find yourself, for example, wanting to actually invoke a method represented by a JMethod.
Method Summary | |
---|---|
java.lang.reflect.Constructor |
getConstructorOn(JConstructor ctor,
java.lang.Class containedin)
Returns the java.lang.Method on a given java.lang.Class which is represented by a given JMethod. |
java.lang.reflect.Field |
getFieldOn(JField field,
java.lang.Class containedin)
Returns the java.lang.Method on a given java.lang.Class which is represented by a given JMethod. |
static JamUtils |
getInstance()
|
java.lang.reflect.Method |
getMethodOn(JMethod method,
java.lang.Class containedin)
Returns the java.lang.Method on a given java.lang.Class which is represented by a given JMethod. |
java.lang.Class |
loadClass(JClass clazz,
java.lang.ClassLoader inThisClassloader)
Loads the java.lang.Class represented by a given JClass out of a given classloader. |
void |
placeInSourceOrder(JElement[] elements)
Sorts the given array in place so that the elements are ordered by their sourcePosition's line numbers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static final JamUtils getInstance()
public java.lang.reflect.Method getMethodOn(JMethod method, java.lang.Class containedin) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException
Returns the java.lang.Method on a given java.lang.Class which is represented by a given JMethod.
containedin
- Class to be searched for the method.
java.lang.ClassNotFoundException
- if one of the paramType classes specified
for this MethodName cannot be loaded from the given class' classloader.
java.lang.NoSuchMethodException
- If the named method does not exist on
this class.
java.lang.IllegalArgumentException
- if any argument is nullpublic java.lang.reflect.Constructor getConstructorOn(JConstructor ctor, java.lang.Class containedin) throws java.lang.NoSuchMethodException, java.lang.ClassNotFoundException
Returns the java.lang.Method on a given java.lang.Class which is represented by a given JMethod.
containedin
- Class to be searched for the ctor.
java.lang.ClassNotFoundException
- if one of the paramType classes specified
for this MethodName cannot be loaded from the given class' classloader.
java.lang.NoSuchMethodException
- If the named ctor does not exist on
this class.
java.lang.IllegalArgumentException
- if any argument is nullpublic java.lang.reflect.Field getFieldOn(JField field, java.lang.Class containedin) throws java.lang.NoSuchFieldException
Returns the java.lang.Method on a given java.lang.Class which is represented by a given JMethod.
containedin
- Class to be searched for the method.
java.lang.NoSuchFieldException
- if the field does not exist on the class.
java.lang.IllegalArgumentException
- if any argument is nullpublic java.lang.Class loadClass(JClass clazz, java.lang.ClassLoader inThisClassloader) throws java.lang.ClassNotFoundException
Loads the java.lang.Class represented by a given JClass out of a given classloader.
java.lang.ClassNotFoundException
- If the class is not found in the classloaderpublic void placeInSourceOrder(JElement[] elements)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |