Package | Description |
---|---|
messif.algorithms |
Search algorithms base classes.
|
messif.utility.reflection |
Utilities to create objects from strings using reflection.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
Algorithm.executeMethodWithStringArguments(java.lang.String[] methodNameAndArguments,
int methodNameIndex,
java.util.Map<java.lang.String,java.lang.Object> namedInstances)
Executes a given method on this algorithm and returns the result.
|
java.lang.Object |
Algorithm.methodExecute(java.lang.String methodName,
java.lang.Object[] methodArguments)
Executes a given method on this algorithm and returns the result.
|
Modifier and Type | Method and Description |
---|---|
static <T> T |
MethodInstantiator.callFactoryMethod(java.lang.Class<? extends T> factoryClass,
java.lang.String name,
boolean convertStringArguments,
boolean publicOnlyMethods,
java.util.Map<java.lang.String,?> namedInstances,
java.lang.Object... arguments)
Calls a method with the given name and prototype from the given method class.
|
static java.lang.Object |
MethodInstantiator.callMethod(java.lang.Object methodInstanceOrClass,
java.lang.String name,
boolean convertStringArguments,
boolean publicOnlyMethods,
java.util.Map<java.lang.String,?> namedInstances,
java.lang.Object... arguments)
Calls a method with the given name and prototype from the given method class.
|
<T> T |
InstantiatorSignature.create(java.lang.Class<? extends T> checkClass,
java.util.Map<java.lang.String,?> namedInstances)
Creates an instance for the parsed signature.
|
static <T> T |
ConstructorInstantiator.createInstanceWithStringArgs(java.lang.Class<? extends T> clazz,
java.lang.Object[] arguments,
int argStartIndex,
int argEndIndex,
java.util.Map<java.lang.String,java.lang.Object> namedInstances)
Creates a new instance of a class using string arguments for its constructor.
|
static <T> T |
ConstructorInstantiator.createInstanceWithStringArgs(java.lang.reflect.Constructor<T>[] constructors,
java.lang.Object[] arguments,
int argStartIndex,
int argEndIndex,
java.util.Map<java.lang.String,java.lang.Object> namedInstances)
Creates a new instance of a class using string arguments for its constructor.
|
static <E> E |
InstantiatorSignature.createInstanceWithStringArgs(java.lang.String signature,
java.lang.Class<E> checkClass,
java.util.Map<java.lang.String,?> namedInstances)
Creates a new instance of a class with a string constructor/factory-method/static-field signature.
|
<T> Instantiator<T> |
InstantiatorSignature.createInstantiator(java.lang.Class<? extends T> checkClass)
Creates instantiator for the parsed signature.
|
static <T> java.lang.reflect.Constructor<T> |
ConstructorInstantiator.getConstructor(java.lang.Class<T> constructorClass,
boolean convertStringArguments,
boolean publicOnlyConstructors,
java.util.Map<java.lang.String,java.lang.Object> namedInstances,
java.util.List<java.lang.Object> arguments)
Returns a constructor for the specified class that accepts the specified arguments.
|
static <T> java.lang.reflect.Constructor<T> |
ConstructorInstantiator.getConstructor(java.lang.Class<T> constructorClass,
boolean publicOnlyConstructors,
java.lang.Class<?>... prototype)
Retrieves a public constructor with the given prototype from the given class.
|
static <T> java.lang.reflect.Constructor<T> |
ConstructorInstantiator.getConstructor(java.lang.Class<T> constructorClass,
boolean publicOnlyConstructors,
int argumentCount)
Retrieves a public constructor with the given number of arguments from the given class.
|
static <T> java.lang.reflect.Constructor<T> |
ConstructorInstantiator.getConstructor(java.lang.reflect.Constructor<T>[] constructors,
int argumentCount)
Retrieves a public constructor with the given number of arguments from the given class.
|
static java.lang.reflect.Field |
FieldInstantiator.getField(java.lang.Class<?> fieldClass,
boolean publicOnlyField,
java.lang.String name)
Retrieves a field with the given name from the given class.
|
static java.lang.reflect.Method |
MethodInstantiator.getMethod(java.lang.Class<?> methodClass,
java.lang.String name,
boolean convertStringArguments,
boolean publicOnlyMethods,
java.util.Map<java.lang.String,?> namedInstances,
java.lang.Object[] arguments)
Retrieves a method with the given name and prototype from the given method class.
|
static java.lang.reflect.Method |
MethodInstantiator.getMethod(java.lang.Class<?> methodClass,
java.lang.String name,
boolean publicOnlyMethods,
java.lang.Class<?>... prototype)
Retrieves a method with the given name and prototype from the given method class.
|
static java.lang.reflect.Method |
MethodInstantiator.getMethod(java.lang.Class<?> methodClass,
java.lang.String name,
boolean publicOnlyMethods,
int argumentCount)
Retrieves a method with the given name and argument count from the given method class.
|
static <T> T |
ConstructorInstantiator.instantiateByConstructor(java.lang.Class<? extends T> objectClass,
boolean convertStringArguments,
java.util.Map<java.lang.String,?> namedInstances,
java.lang.Object[] arguments)
Creates a new instance using a constructor from the given class that matches the arguments.
|
Constructor and Description |
---|
ConstructorInstantiator(java.lang.Class<? extends T> objectClass,
boolean convertStringArguments,
java.util.Map<java.lang.String,?> namedInstances,
java.lang.Object[] arguments)
Creates a new instance of ConstructorInstantiator for creating instances of
objectClass that accepts the given arguments. |
ConstructorInstantiator(java.lang.Class<? extends T> objectClass,
java.lang.Class<?>... prototype)
Creates a new instance of ConstructorInstantiator for creating instances of
objectClass that accepts parameters of the given prototype. |
ConstructorInstantiator(java.lang.Class<? extends T> objectClass,
int argumentCount)
Creates a new instance of ConstructorInstantiator for creating instances of
objectClass that accepts the given number of arguments. |
ConstructorInstantiator(java.lang.Class<? extends T> objectClass,
java.lang.Object[] arguments)
Creates a new instance of ConstructorInstantiator for creating instances of
objectClass that accepts the given arguments. |
ConstructorInstantiator(java.lang.reflect.Constructor<? extends T> constructor)
Creates a new instance of ConstructorInstantiator for creating instances of
objectClass via the specified constructor. |
ConstructorInstantiatorWithArguments(java.lang.Class<? extends T> objectClass,
java.lang.Object... arguments)
Creates a new instance of ConstructorInstantiatorWithArguments for creating instances of
objectClass that accepts the given arguments. |
ConstructorInstantiatorWithArguments(java.lang.Class<? extends T> objectClass,
java.lang.String[] arguments,
int offset,
int length,
java.util.Map<java.lang.String,java.lang.Object> namedInstances)
Creates a new instance of ConstructorInstantiatorWithArguments for creating instances of
objectClass that accepts the given string arguments. |
ConstructorInstantiatorWithArguments(java.lang.reflect.Constructor<? extends T> constructor,
java.lang.Object... arguments)
Creates a new instance of ConstructorInstantiatorWithArguments for creating instances of
T using the specified constructor and with the given stored arguments.
|
FieldInstantiator(java.lang.Class<? extends T> checkClass,
java.lang.Class<?> fieldClass,
java.lang.String fieldName)
Creates a new instance of FieldInstantiator for creating instances of
objectClass . |
FieldInstantiator(java.lang.Class<? extends T> objectClass,
java.lang.reflect.Field field,
java.lang.Object fieldInstance)
Creates a new instance of FieldInstantiator for creating instances of
objectClass via the given field. |
FieldInstantiator(java.lang.Class<? extends T> checkClass,
java.lang.Object fieldInstance,
java.lang.String fieldName)
Creates a new instance of FieldInstantiator for creating instances of
objectClass . |
MethodInstantiator(java.lang.Class<? extends T> checkClass,
java.lang.Class<?> methodClass,
java.lang.String methodName,
boolean convertStringArguments,
java.util.Map<java.lang.String,?> namedInstances,
java.lang.Object[] arguments)
Creates a new instance of MethodInstantiator for creating instances of
objectClass by calling a method with the specified name
and the number of parameters on the given callInstance . |
MethodInstantiator(java.lang.Class<? extends T> checkClass,
java.lang.Class<?> methodClass,
java.lang.String methodName,
java.lang.Class<?>... prototype)
Creates a new instance of MethodInstantiator for creating instances of
objectClass by calling a factory method with the specified name and prototype. |
MethodInstantiator(java.lang.Class<? extends T> checkClass,
java.lang.Class<?> methodClass,
java.lang.String methodName,
int argumentCount)
Creates a new instance of MethodInstantiator for creating instances of
objectClass by calling a factory method with the specified name
and the number of parameters. |
MethodInstantiator(java.lang.Class<? extends T> objectClass,
java.lang.reflect.Method method,
java.lang.Object callInstance)
Creates a new instance of MethodInstantiator for creating instances of
objectClass via the given method. |
MethodInstantiator(java.lang.Class<? extends T> checkClass,
java.lang.Object callInstance,
java.lang.String methodName,
boolean convertStringArguments,
java.util.Map<java.lang.String,?> namedInstances,
java.lang.Object[] arguments)
Creates a new instance of MethodInstantiator for creating instances of
objectClass by calling a method with the specified name
and the number of parameters on the given callInstance . |
MethodInstantiator(java.lang.Class<? extends T> checkClass,
java.lang.Object callInstance,
java.lang.String methodName,
java.lang.Class<?>... prototype)
Creates a new instance of MethodInstantiator for creating instances of
objectClass by calling a method with the specified name and prototype
on the given callInstance . |
MethodInstantiator(java.lang.Class<? extends T> checkClass,
java.lang.Object callInstance,
java.lang.String methodName,
int argumentCount)
Creates a new instance of MethodInstantiator for creating instances of
objectClass by calling a method with the specified name
and the number of parameters on the given callInstance . |