public interface ValueExtractor
| Modifier and Type | Method and Description |
|---|---|
default Optional<Field> |
findField(Class<?> clazz,
String name)
Find field with the given name of the specified class.
|
default Optional<Field> |
findField(Class<?> clazz,
String name,
Class<?> type)
Find the field with the given name of the specified class.
|
default Optional<Method> |
findMethod(Class<?> clazz,
String name)
Find the method with the given name and no parameters of the specified class.
|
default Optional<Method> |
findMethod(Class<?> clazz,
String name,
Class<?>... paramTypes)
Find the method with the given name and parameters of the specified class.
|
Object |
findValue(Object obj,
String field)
Find the value of the given add name or path of the given object.
|
default String[] |
getPossibleMethodNames(String name)
Get possible method names of the given field name.
|
default Object |
invoke(Field field,
Object obj)
Invoke the given field on the given object.
|
default Object |
invoke(Method method,
Object obj)
Invoke the given method on the given object.
|
Object findValue(Object obj, String field)
obj - the objectfield - the field name or pathValueExtractorException - if no add nor method is founddefault Optional<Field> findField(Class<?> clazz, String name)
clazz - the classname - the field namedefault Optional<Field> findField(Class<?> clazz, String name, Class<?> type)
clazz - the classname - the field nametype - the type of the fielddefault String[] getPossibleMethodNames(String name)
If 'firstName' is given for example, 'firstName', 'getFirstName'
and 'isFirstName' will be returned.
name - the field namedefault Optional<Method> findMethod(Class<?> clazz, String name)
clazz - the classname - the method namedefault Optional<Method> findMethod(Class<?> clazz, String name, Class<?>... paramTypes)
clazz - the classname - the method nameparamTypes - the parameter typesdefault Object invoke(Method method, Object obj)
setAccessible(true) will be called.method - the methodobj - the objectValueExtractorException - if a IllegalAccessException or a InvocationTargetException occursdefault Object invoke(Field field, Object obj)
setAccessible(true) will be called.field - the fieldobj - the objectValueExtractorException - if a IllegalAccessException occursCopyright © 2019 bremersee.org. All rights reserved.