Package io.mateu.reflection
Class ReflectionHelper
java.lang.Object
io.mateu.reflection.BaseReflectionHelper
io.mateu.reflection.ReflectionHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CollectionaddToCollection(FieldInterfaced field, Object bean) static CollectionaddToCollection(FieldInterfaced field, Object bean, Object i) static voidaddToMap(FieldInterfaced field, Object bean, Object k, Object v) static MethodbuildMethod(Class<?> c, String methodName) static Objectstatic voidstatic voidstatic <T> com.google.common.collect.ImmutableList<T>extend(com.google.common.collect.ImmutableList<T> list, T o) static <K,V> com.google.common.collect.ImmutableMap<K, V> extend(com.google.common.collect.ImmutableMap<K, V> list, K k, V v) static <T> com.google.common.collect.ImmutableSet<T>extend(com.google.common.collect.ImmutableSet<T> list, T o) static <T> Collection<T>extend(Collection<T> list, T o) static <T> List<T>static <K,V> Map<K, V> static <T> Set<T>static <T> TfillQueryResult(List<FieldInterfaced> fields, Object[] o, T t) static Objectstatic List<FieldInterfaced>getAllEditableFields(Class modelType) static List<FieldInterfaced>getAllEditableFields(Class modelType, Class superType, boolean includeReverseMappers) static List<FieldInterfaced>getAllEditableFields(Class modelType, Class superType, boolean includeReverseMappers, FieldInterfaced field) static List<FieldInterfaced>getAllEditableFilteredFields(Class modelType, String fieldsFilter, List<FieldInterfaced> editableFields) static List<FieldInterfaced>static List<FieldInterfaced>static List<FieldInterfaced>getAllTransferrableFields(Class modelType) static Stringstatic StringgetCaption(Object o) static StringgetCaption(Method f) static ConstructorgetConstructor(Class type) static ConstructorgetConstructor(Class c, Class parameterClass) static FieldInterfacedgetFieldByName(Class sourceClass, String fieldName) static StringgetFirstUpper(String fieldName) static ClassgetGenericClass(FieldInterfaced field, Class asClassOrInterface, String genericArgumentName) static Class<?>getGenericClass(Class type) static ClassgetGenericClass(Class sourceClass, Class asClassOrInterface, String genericArgumentName) static Class<?>static ClassgetGenericClass(ParameterizedType parameterizedType, Class sourceClass, Class asClassOrInterface, String genericArgumentName) static ClassgetGenericClass(ParameterizedType parameterizedType, Class asClassOrInterface, String genericArgumentName) static Class<?>getGenericClass(Type type) static Stringstatic Stringstatic Stringstatic Stringstatic Objectstatic FieldInterfacedgetIdField(Class type) static List<FieldInterfaced>getKpiFields(Class modelType) static FieldInterfacedgetMapper(FieldInterfaced field) static Methodstatic FieldInterfacedgetNameField(Class entityClass, boolean toStringPreferred) static Stringstatic Stringstatic Stringstatic ObjectgetValue(FieldInterfaced f, Object o) static ObjectgetValue(FieldInterfaced f, Object o, Object valueIfNull) static Objectstatic Objectstatic Fieldstatic booleanstatic booleanstatic booleanisInjectable(Executable m, Parameter p) static booleanisOverridden(Object instance, String methodName) static booleanisOwner(FieldInterfaced field) static voidstatic <T> TnewInstance(Class<T> c) static ObjectnewInstance(Class c, Object parent) static ObjectnewInstance(Constructor c, Object params) static booleanpuedeAnadir(FieldInterfaced field) static booleanpuedeBorrar(FieldInterfaced field) static <T> com.google.common.collect.ImmutableList<T>remove(com.google.common.collect.ImmutableList<T> list, T o) static <K,V> com.google.common.collect.ImmutableMap<K, V> remove(com.google.common.collect.ImmutableMap<K, V> list, K o) static <T> com.google.common.collect.ImmutableSet<T>remove(com.google.common.collect.ImmutableSet<T> list, T o) static <T> Collection<T>remove(Collection<T> list, T o) static <T> List<T>static <T> Set<T>static <T> com.google.common.collect.ImmutableList<T>removeAll(com.google.common.collect.ImmutableList<T> list, Collection o) static <T> com.google.common.collect.ImmutableSet<T>removeAll(com.google.common.collect.ImmutableSet<T> list, Collection o) static <T> Collection<T>removeAll(Collection<T> list, Collection o) static <T> List<T>removeAll(List<T> list, Collection o) static <T> Set<T>removeAll(Set<T> list, Collection o) static voidremoveFromMap(FieldInterfaced field, Object bean, Set l) static voidsetBeanProvider(BeanProvider aBeanProvider) static voidsetValue(FieldInterfaced f, Object o, Object v) static voidstatic voidtoHtml(PrintWriter pw, Object o, List visited) static Stringstatic StringMethods inherited from class io.mateu.reflection.BaseReflectionHelper
isBasico, isBasico
-
Constructor Details
-
ReflectionHelper
public ReflectionHelper()
-
-
Method Details
-
setBeanProvider
-
getValue
-
setValue
public static void setValue(String fn, Object o, Object v) throws InvocationTargetException, IllegalAccessException, NoSuchMethodException -
getValue
public static Object getValue(String id, Object o) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException -
getMethod
-
buildMethod
-
getGetter
-
getGetter
-
getGetter
-
getSetter
-
getSetter
-
getAllMethods
-
_getAllMethods
-
buildAllMethods
-
getAllFields
-
getAllFields
-
isInjectable
-
getId
-
getIdField
-
getVersionField
-
getNameField
-
getFieldByName
-
getGenericClass
public static Class getGenericClass(ParameterizedType parameterizedType, Class asClassOrInterface, String genericArgumentName) -
getGenericClass
-
getGenericClass
public static Class getGenericClass(ParameterizedType parameterizedType, Class sourceClass, Class asClassOrInterface, String genericArgumentName) -
fillQueryResult
public static <T> T fillQueryResult(List<FieldInterfaced> fields, Object[] o, T t) throws IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException -
getKpiFields
-
getAllTransferrableFields
-
getAllEditableFields
-
getAllEditableFilteredFields
public static List<FieldInterfaced> getAllEditableFilteredFields(Class modelType, String fieldsFilter, List<FieldInterfaced> editableFields) -
getAllEditableFields
public static List<FieldInterfaced> getAllEditableFields(Class modelType, Class superType, boolean includeReverseMappers) -
getCaption
-
getCaption
-
getGenericClass
-
getGenericClass
-
getSubclasses
-
getGenericClass
-
main
- Throws:
Exception
-
getFirstUpper
-
clone
public static Object clone(Object original) throws IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException -
delete
public static void delete(jakarta.persistence.EntityManager em, Object o) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException -
copy
-
newInstance
- Throws:
Throwable
-
newInstance
public static <T> T newInstance(Class<T> c) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException -
newInstance
public static Object newInstance(Class c, Object parent) throws IllegalAccessException, InstantiationException, InvocationTargetException, NoSuchMethodException -
getConstructor
-
getConstructor
-
toHtml
-
toHtml
-
toJson
-
fromJson
-
extend
-
extend
-
extend
public static <T> com.google.common.collect.ImmutableList<T> extend(com.google.common.collect.ImmutableList<T> list, T o) -
extend
-
extend
public static <T> com.google.common.collect.ImmutableSet<T> extend(com.google.common.collect.ImmutableSet<T> list, T o) -
extend
-
extend
public static <K,V> com.google.common.collect.ImmutableMap<K,V> extend(com.google.common.collect.ImmutableMap<K, V> list, K k, V v) -
remove
-
remove
-
remove
-
remove
public static <T> com.google.common.collect.ImmutableList<T> remove(com.google.common.collect.ImmutableList<T> list, T o) -
remove
public static <T> com.google.common.collect.ImmutableSet<T> remove(com.google.common.collect.ImmutableSet<T> list, T o) -
remove
public static <K,V> com.google.common.collect.ImmutableMap<K,V> remove(com.google.common.collect.ImmutableMap<K, V> list, K o) -
removeAll
-
removeAll
-
removeAll
-
removeAll
public static <T> com.google.common.collect.ImmutableList<T> removeAll(com.google.common.collect.ImmutableList<T> list, Collection o) -
removeAll
public static <T> com.google.common.collect.ImmutableSet<T> removeAll(com.google.common.collect.ImmutableSet<T> list, Collection o) -
isOverridden
-