Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.gui4j.core
Class Gui4jReflectionManager  view Gui4jReflectionManager download Gui4jReflectionManager.java

java.lang.Object
  extended byorg.gui4j.core.Gui4jReflectionManager
All Implemented Interfaces:
org.gui4j.exception.ErrorTags, java.io.Serializable

public final class Gui4jReflectionManager
extends java.lang.Object
implements org.gui4j.exception.ErrorTags, java.io.Serializable

Supports methods to method declarations by most specific argument types There is always one instance of this manager in order to cache method declarations.


Field Summary
private static org.apache.commons.logging.Log mLogger
           
private  java.util.Map mMethodsClass
           
private  java.util.Map mMethodsName
           
 
Fields inherited from interface org.gui4j.exception.ErrorTags
EXCEPTION_OCCURED, PROGRAMMING_ERROR, PROGRAMMING_ERROR_illegal_access_exception, PROGRAMMING_ERROR_instantiation_exception, PROGRAMMING_ERROR_invocation_target_exception, PROGRAMMING_ERROR_method_ambiguous, PROGRAMMING_ERROR_method_not_found, PROGRAMMING_ERROR_parameter_null, RESOURCE_ERROR, RESOURCE_ERROR_access_type_not_compatible, RESOURCE_ERROR_access_unexpected_character, RESOURCE_ERROR_access_unexpected_end, RESOURCE_ERROR_access_value_type_not_defined, RESOURCE_ERROR_alias_already_defined, RESOURCE_ERROR_alias_class_not_found, RESOURCE_ERROR_alias_not_defined_in_path, RESOURCE_ERROR_alias_undefined, RESOURCE_ERROR_attribute_editable_defined, RESOURCE_ERROR_attribute_listEditable_defined, RESOURCE_ERROR_attribute_not_defined, RESOURCE_ERROR_double_DataConversionException, RESOURCE_ERROR_element_at_row_col_already_defined, RESOURCE_ERROR_gui4jComponent_already_defined, RESOURCE_ERROR_gui4jComponent_already_registered, RESOURCE_ERROR_gui4jComponent_not_defined, RESOURCE_ERROR_gui4jComponent_not_registered, RESOURCE_ERROR_int_DataConversionException, RESOURCE_ERROR_invalid_column, RESOURCE_ERROR_invalid_defaultButton, RESOURCE_ERROR_invalid_keystroke, RESOURCE_ERROR_invalid_row, RESOURCE_ERROR_invalid_url, RESOURCE_ERROR_jdom_exception, RESOURCE_ERROR_labelform_column_conflict, RESOURCE_ERROR_placement_must_contain_gui4jComponent, RESOURCE_ERROR_property_getter_type_incompatible, RESOURCE_ERROR_style_defined_twice, RESOURCE_ERROR_style_not_defined, RESOURCE_ERROR_tableLayout_invalid_col_row_str, RESOURCE_ERROR_type_not_compatible, RESOURCE_ERROR_unexpected_gui4jStyle_end, RESOURCE_ERROR_unknown_param, RESOURCE_ERROR_unknown_param_in_include
 
Constructor Summary
private Gui4jReflectionManager()
           
 
Method Summary
private  java.util.List arr2List(java.lang.Object[] arr)
           
 org.gui4j.core.util.MethodCall getMethod(java.lang.String context, java.lang.Class c, java.lang.String methodName, java.lang.Class[] argumentsInit)
          Searches for the given class the most specific method.
 org.gui4j.core.util.MethodCall getMethod(java.lang.String context, java.lang.Class c, java.lang.String methodName, java.lang.Class[] argumentsInit, boolean throwExceptionIfNotFound)
           
private  java.lang.reflect.Method[] getMethods(java.lang.Class c)
           
private  java.lang.reflect.Method[] getMethods(java.lang.Class c, java.lang.String methodName)
           
static Gui4jReflectionManager getNewInstance()
          Returns always the same instance
static void handleInvocationTargetException(java.lang.reflect.InvocationTargetException e)
           
private  boolean matching(java.lang.reflect.Method m, java.lang.Class[] arguments)
           
private  boolean moreSpecific(java.lang.reflect.Method m1, java.lang.reflect.Method m2)
           
 void reload()
          Clear the cache in order to use new method declarations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mLogger

private static final org.apache.commons.logging.Log mLogger

mMethodsClass

private final java.util.Map mMethodsClass

mMethodsName

private final java.util.Map mMethodsName
Constructor Detail

Gui4jReflectionManager

private Gui4jReflectionManager()
Method Detail

getNewInstance

public static Gui4jReflectionManager getNewInstance()
Returns always the same instance


getMethod

public org.gui4j.core.util.MethodCall getMethod(java.lang.String context,
                                                java.lang.Class c,
                                                java.lang.String methodName,
                                                java.lang.Class[] argumentsInit,
                                                boolean throwExceptionIfNotFound)

getMethod

public org.gui4j.core.util.MethodCall getMethod(java.lang.String context,
                                                java.lang.Class c,
                                                java.lang.String methodName,
                                                java.lang.Class[] argumentsInit)
Searches for the given class the most specific method. If no method is found, or if the result is ambiguous, an exception is raised


arr2List

private java.util.List arr2List(java.lang.Object[] arr)

moreSpecific

private boolean moreSpecific(java.lang.reflect.Method m1,
                             java.lang.reflect.Method m2)

matching

private boolean matching(java.lang.reflect.Method m,
                         java.lang.Class[] arguments)

getMethods

private java.lang.reflect.Method[] getMethods(java.lang.Class c,
                                              java.lang.String methodName)

getMethods

private java.lang.reflect.Method[] getMethods(java.lang.Class c)

reload

public void reload()
Clear the cache in order to use new method declarations


handleInvocationTargetException

public static void handleInvocationTargetException(java.lang.reflect.InvocationTargetException e)