licensed under GPL v2 or higher.
 
| Method Summary | 
| static boolean | classHasClass(Class cl,
              String name,
              boolean staticRequired)Checks if the specified class has the given inner class.
 | 
| static boolean | classHasField(Class cl,
              String name,
              boolean staticRequired)Checks if the specified class has the given field.
 | 
| static boolean | classHasMethod(Class cl,
               String name,
               boolean staticRequired)Checks if the specified class has the given method.
 | 
| static Class | getClass(Class cl,
         String name,
         boolean staticRequired)Returns an inner class of the class with the given simple name
 | 
| static Class[] | getClasses(Object o)Returns the list of classes of the object
 | 
| static String[] | getClassNames(Object o)Returns the list of class names of the object
 | 
| static String | getCompletionName(Member m)Completion name of a member.
 | 
| static Constructor | getConstructor(Class o_clazz,
               Class[] arg_clazz,
               boolean[] arg_is_null)Attempts to find the best-matching constructor of the class
 o_clazz with the parameter types arg_clazz
 | 
| static String[] | getFieldNames(Class cl,
              boolean staticRequired)Returns the names of the fields of a given class
 | 
| static String | getFieldTypeName(Class cl,
                 String field)
 | 
| static Method | getMethod(Class o_clazz,
          String name,
          Class[] arg_clazz,
          boolean[] arg_is_null)Attempts to find the best-matching method of the class
 o_clazzwith the method namenameand arguments types defined byarg_clazz. | 
| static String[] | getMethodNames(Class cl,
               boolean staticRequired)Returns the completion names of the methods of a given class.
 | 
| static String[] | getSimpleClassNames(Object o,
                    boolean addConditionClasses)Returns the list of simple class names of the object
 | 
| static Class[] | getStaticClasses(Class cl)Returns the static inner classes of the class
 | 
| static Field[] | getStaticFields(Class cl)Returns the static fields of the class
 | 
| static Method[] | getStaticMethods(Class cl)Returns the static methods of the class
 | 
| static boolean | hasClass(Object o,
         String name)Checks if the class of the object has the given inner class.
 | 
| static boolean | hasField(Object o,
         String name)Checks if the class of the object has the given field.
 | 
| static boolean | hasMethod(Object o,
          String name)Checks if the class of the object has the given method.
 | 
| static Object | invokeMethod(Class o_clazz,
             Object o,
             String name,
             Object[] args,
             Class[] clazzes)Invoke a method of a given class
 First the appropriate method is resolved by getMethod and
 then invokes the method
 | 
| static boolean | isStatic(Class clazz)Indicates if a class is static
 | 
| static boolean | isStatic(Member member)Indicates if a member of a Class (field, method ) is static
 | 
| static Object | newInstance(Class o_clazz,
            Object[] args,
            Class[] clazzes)Object creator.
 | 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
RJavaTools
public RJavaTools()
getClass
public static Class getClass(Class cl,
                             String name,
                             boolean staticRequired)
- Returns an inner class of the class with the given simple name
 
- 
- Parameters:
- cl- class
- name- simple name of the inner class
- staticRequired- boolean, if- truethe inner class is required to be static
 
getStaticClasses
public static Class[] getStaticClasses(Class cl)
- Returns the static inner classes of the class
 
- 
- Parameters:
- cl- class
- Returns:
- an array of classes or null if cl does not have static inner classes
 
isStatic
public static boolean isStatic(Class clazz)
- Indicates if a class is static
 
- 
- Parameters:
- clazz- class
- Returns:
- true if the class is static
 
getStaticFields
public static Field[] getStaticFields(Class cl)
- Returns the static fields of the class
 
- 
- Parameters:
- cl- class
- Returns:
- an array of static fields
 
getStaticMethods
public static Method[] getStaticMethods(Class cl)
- Returns the static methods of the class
 
- 
- Parameters:
- cl- class
- Returns:
- an array of static fields
 
getFieldNames
public static String[] getFieldNames(Class cl,
                                     boolean staticRequired)
- Returns the names of the fields of a given class
 
- 
- Parameters:
- cl- class
- staticRequired- if true only static fields are returned
- Returns:
- the public (and maybe only static) names of the fields.
 
getMethodNames
public static String[] getMethodNames(Class cl,
                                      boolean staticRequired)
- Returns the completion names of the methods of a given class. 
 See the getMethodCompletionName method below
 
- 
- Parameters:
- cl- class
- staticRequired- if true only static methods are returned
- Returns:
- the public (and maybe only static) names of the methods.
 
getCompletionName
public static String getCompletionName(Member m)
- Completion name of a member. 
 
 For fields, it just returns the name of the fields
  For methods, this returns the name of the method
 plus a suffix that depends on the number of arguments of the method.
 
  The string "()" is added 
 if the method has no arguments, and the string "(" is added
 if the method has one or more arguments.
 
 
- 
 
isStatic
public static boolean isStatic(Member member)
- Indicates if a member of a Class (field, method ) is static
 
- 
- Parameters:
- member- class member
- Returns:
- true if the member is static
 
hasField
public static boolean hasField(Object o,
                               String name)
- Checks if the class of the object has the given field. The 
 getFields method of Class is used so only public fields are 
 checked
 
- 
- Parameters:
- o- object
- name- name of the field
- Returns:
- trueif the class of- ohas the field- name
 
hasClass
public static boolean hasClass(Object o,
                               String name)
- Checks if the class of the object has the given inner class. The 
 getClasses method of Class is used so only public classes are 
 checked
 
- 
- Parameters:
- o- object
- name- (simple) name of the inner class
- Returns:
- trueif the class of- ohas the class- name
 
classHasField
public static boolean classHasField(Class cl,
                                    String name,
                                    boolean staticRequired)
- Checks if the specified class has the given field. The 
 getFields method of Class is used so only public fields are 
 checked
 
- 
- Parameters:
- cl- class object
- name- name of the field
- staticRequired- if- truethen the field is required to be static
- Returns:
- trueif the class- clhas the field- name
 
classHasMethod
public static boolean classHasMethod(Class cl,
                                     String name,
                                     boolean staticRequired)
- Checks if the specified class has the given method. The 
 getMethods method of Class is used so only public methods are 
 checked
 
- 
- Parameters:
- cl- class
- name- name of the method
- staticRequired- if- truethen the method is required to be static
- Returns:
- trueif the class- clhas the method- name
 
classHasClass
public static boolean classHasClass(Class cl,
                                    String name,
                                    boolean staticRequired)
- Checks if the specified class has the given inner class. The 
 getClasses method of Class is used so only public classes are 
 checked
 
- 
- Parameters:
- cl- class
- name- name of the inner class
- staticRequired- if- truethen the method is required to be static
- Returns:
- trueif the class- clhas the field- name
 
hasMethod
public static boolean hasMethod(Object o,
                                String name)
- Checks if the class of the object has the given method. The 
 getMethods method of Class is used so only public methods are 
 checked
 
- 
- Parameters:
- o- object
- name- name of the method
- Returns:
- trueif the class of- ohas the field- name
 
newInstance
public static Object newInstance(Class o_clazz,
                                 Object[] args,
                                 Class[] clazzes)
                          throws Throwable
- Object creator. Find the best constructor based on the parameter classes
 and invoke newInstance on the resolved constructor
 
- 
- Throws:
- Throwable
 
invokeMethod
public static Object invokeMethod(Class o_clazz,
                                  Object o,
                                  String name,
                                  Object[] args,
                                  Class[] clazzes)
                           throws Throwable
- Invoke a method of a given class
 First the appropriate method is resolved by getMethod and
 then invokes the method
 
 
- 
- Throws:
- Throwable
 
getConstructor
public static Constructor getConstructor(Class o_clazz,
                                         Class[] arg_clazz,
                                         boolean[] arg_is_null)
                                  throws SecurityException,
                                         NoSuchMethodException
- Attempts to find the best-matching constructor of the class
 o_clazz with the parameter types arg_clazz
 
- 
- Parameters:
- o_clazz- Class to look for a constructor
- arg_clazz- parameter types
- arg_is_null- indicates if each argument is null
- Returns:
- nullif no constructor is found, or the constructor
- Throws:
- SecurityException
- NoSuchMethodException
 
getMethod
public static Method getMethod(Class o_clazz,
                               String name,
                               Class[] arg_clazz,
                               boolean[] arg_is_null)
                        throws SecurityException,
                               NoSuchMethodException
- Attempts to find the best-matching method of the class o_clazzwith the method namenameand arguments types defined byarg_clazz.
 The lookup is performed by finding the most specific methods that matches the supplied arguments (see alsoisMoreSpecific(java.lang.reflect.Method, java.lang.reflect.Method)).
 
- 
- Parameters:
- o_clazz- class in which to look for the method
- name- method name
- arg_clazz- an array of classes defining the types of arguments
- arg_is_null- indicates if each argument is null
- Returns:
- nullif no matching method could be found or the best matching method.
- Throws:
- SecurityException
- NoSuchMethodException
 
getClasses
public static Class[] getClasses(Object o)
- Returns the list of classes of the object
 
- 
- Parameters:
- o- an Object
 
getClassNames
public static String[] getClassNames(Object o)
- Returns the list of class names of the object
 
- 
- Parameters:
- o- an Object
 
getSimpleClassNames
public static String[] getSimpleClassNames(Object o,
                                           boolean addConditionClasses)
- Returns the list of simple class names of the object
 
- 
- Parameters:
- o- an Object
 
getFieldTypeName
public static String getFieldTypeName(Class cl,
                                      String field)
- 
- Parameters:
- cl- class
- field- name of the field
- Returns:
- the class name of the field of the class (or null) 
 if the class does not have the given field)