org.objectweb.jonathan.libs.kernel.decoders
Class DecoderHelper
java.lang.Object
org.objectweb.jonathan.libs.kernel.decoders.DecoderHelper
public class DecoderHelper
extends java.lang.Object
Helper class providing methods used by JImpicitFactory, KAtom and KAssemblage.
static Object | apply(Constructor _constructor, List _arguments, Context _context, Instanciable _instance) - "applies" the _context Context's elements on the
implementation alternative whose signature is
_constructor(_arguments), i.e.
|
static Object | apply(Object _object, Method _method, List _arguments, Context _context, Instanciable _instance) - "applies" the _context Context's elements on the
specified method whose signature is
_method(_arguments), i.e.
|
static String | getClassNameForArray(String _array) - Return the class name corresponding to the
_array given.
|
static Constructor | getConstructor(String _classe, List _arguments, Component _context) - Returns the
_classe java class's Constructor whose arguments'types
are listed in _arguments as JArguments.
|
static Method | getMethod(Class _class, String _name, 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(String _type) - Test if the
_type given is an array class name.
|
apply
public static Object apply(Constructor _constructor,
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.
- find and instantiates _arguments' JArguments
- instantiates _constructor with them as its
parameters
_constructor
- constructor to call_arguments
- its arguments_context
- contains the instanciation parameterd
- the created instance
JonathanException
- if something goes wrong.
apply
public static Object apply(Object _object,
Method _method,
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.
- find and instantiates _arguments' JArguments
- calls _method with them as its
parameters on the object _object
_object
- the object calling method_method
- method to call_arguments
- its arguments_context
- contains the instanciation parameters
JonathanException
- if something goes wrong.
getClassNameForArray
public static String getClassNameForArray(String _array)
Return the class name corresponding to the _array
given.
_array
- the array to be studied
- this array class name.
getConstructor
public static Constructor getConstructor(String _classe,
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).
_classe
- the class's..._arguments
- ...signature
- its Class constructor
JonathanException
- if something goes wrong.
getMethod
public static Method getMethod(Class _class,
String _name,
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).
_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
- its Class method
JonathanException
- if something goes wrong.
isArrayClassName
public static boolean isArrayClassName(String _type)
Test if the _type
given is an array class name.
_type
- the type to be tested
- true if it is an array class name, false otherwise.