org.objectweb.jonathan.libs.kernel.decoders
Class DecoderHelper

java.lang.Object
  extended byorg.objectweb.jonathan.libs.kernel.decoders.DecoderHelper

public class DecoderHelper
extends java.lang.Object

Helper class providing methods used by JImpicitFactory, KAtom and KAssemblage.


Constructor Summary
DecoderHelper()
           
 
Method Summary
static java.lang.Object apply(java.lang.reflect.Constructor _constructor, java.util.List _arguments, Context _context, Instanciable _instance)
          "applies" the _context Context's elements on the implementation alternative whose signature is _constructor(_arguments), i.e.
static java.lang.Object apply(java.lang.Object _object, java.lang.reflect.Method _method, java.util.List _arguments, Context _context, Instanciable _instance)
          "applies" the _context Context's elements on the specified method whose signature is _method(_arguments), i.e.
static java.lang.String getClassNameForArray(java.lang.String _array)
          Return the class name corresponding to the _array given.
static java.lang.reflect.Constructor getConstructor(java.lang.String _classe, java.util.List _arguments, Component _context)
          Returns the _classe java class's Constructor whose arguments'types are listed in _arguments as JArguments.
static java.lang.reflect.Method getMethod(java.lang.Class _class, java.lang.String _name, java.util.List _arguments, Component _context)
          Returns the _classe java class's Method whose name is _name and arguments'types are listed in _arguments as JArguments.
static boolean isArrayClassName(java.lang.String _type)
          Test if the _type given is an array class name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DecoderHelper

public DecoderHelper()
Method Detail

getMethod

public static java.lang.reflect.Method getMethod(java.lang.Class _class,
                                                 java.lang.String _name,
                                                 java.util.List _arguments,
                                                 Component _context)
                                          throws JonathanException
Returns the _classe java class's Method whose name is _name and arguments'types are listed in _arguments as JArguments. To reach this goal, this method first tries to find and load each of _arguments' java classes with the ClasspathFinder found at "/classpath_finder" (in the _context context).

Parameters:
_class - the belonging class of the method
_name - the name of the method
_arguments - the parameters of the method
_context - the context in which find the ClasspathFinder
Returns:
its Class method
Throws:
JonathanException - if something goes wrong.

getConstructor

public static java.lang.reflect.Constructor getConstructor(java.lang.String _classe,
                                                           java.util.List _arguments,
                                                           Component _context)
                                                    throws JonathanException
Returns the _classe java class's Constructor whose arguments'types are listed in _arguments as JArguments. To reach this goal, this method first tries to find and load _classe and each of arguments' java classes with the ClasspathFinder found at "/classpath_finder" (in the _context context).

Parameters:
_classe - the class's...
_arguments - ...signature
Returns:
its Class constructor
Throws:
JonathanException - if something goes wrong.

apply

public static java.lang.Object apply(java.lang.Object _object,
                                     java.lang.reflect.Method _method,
                                     java.util.List _arguments,
                                     Context _context,
                                     Instanciable _instance)
                              throws JonathanException
"applies" the _context Context's elements on the specified method whose signature is _method(_arguments), i.e.

Parameters:
_object - the object calling method
_method - method to call
_arguments - its arguments
_context - contains the instanciation parameters
Throws:
JonathanException - if something goes wrong.

apply

public static java.lang.Object apply(java.lang.reflect.Constructor _constructor,
                                     java.util.List _arguments,
                                     Context _context,
                                     Instanciable _instance)
                              throws JonathanException
"applies" the _context Context's elements on the implementation alternative whose signature is _constructor(_arguments), i.e.

Parameters:
_constructor - constructor to call
_arguments - its arguments
_context - contains the instanciation parameterd
Returns:
the created instance
Throws:
JonathanException - if something goes wrong.

isArrayClassName

public static boolean isArrayClassName(java.lang.String _type)
Test if the _type given is an array class name.

Parameters:
_type - the type to be tested
Returns:
true if it is an array class name, false otherwise.

getClassNameForArray

public static java.lang.String getClassNameForArray(java.lang.String _array)
Return the class name corresponding to the _array given.

Parameters:
_array - the array to be studied
Returns:
this array class name.