Class DefaultBeanIntrospector
- java.lang.Object
-
- jadex.commons.transformation.traverser.DefaultBeanIntrospector
-
- All Implemented Interfaces:
IBeanIntrospector
public class DefaultBeanIntrospector extends java.lang.Object implements IBeanIntrospector
Introspector for Java beans. It uses the reflection to build up a map with property infos (name, read/write method, etc.)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
DefaultBeanIntrospector.BeanClassInfo
Infos about a bean class.
-
Field Summary
Fields Modifier and Type Field Description protected LRU<WeakObject<java.lang.Class<?>>,java.util.Map<Tuple2<java.lang.Boolean,java.lang.Boolean>,DefaultBeanIntrospector.BeanClassInfo>>
beaninfos
The cache for saving time for multiple lookups.
-
Constructor Summary
Constructors Constructor Description DefaultBeanIntrospector()
Create a new introspector.DefaultBeanIntrospector(int lrusize)
Create a new introspector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BeanProperty
createBeanProperty(java.lang.String name, java.lang.Class<?> type, java.lang.reflect.Method getter, java.lang.reflect.Method setter, java.lang.Class<?> settertype, java.lang.reflect.Type generictype)
Creates a bean property based on getter/setter.protected BeanProperty
createBeanProperty(java.lang.String name, java.lang.reflect.Field field, boolean anonclass)
Creates a bean property based on a field.protected DefaultBeanIntrospector.BeanClassInfo
getBeanClassInfo(java.lang.Class<?> clazz, boolean includemethods, boolean includefields)
java.lang.invoke.MethodHandle
getBeanConstructor(java.lang.Class<?> clazz, boolean includemethods, boolean includefields)
Get the bean constructor for a specific clazz.java.util.Map<java.lang.String,BeanProperty>
getBeanProperties(java.lang.Class<?> clazz, boolean includemethods, boolean includefields)
Get the bean properties for a specific clazz.
-
-
-
Field Detail
-
beaninfos
protected LRU<WeakObject<java.lang.Class<?>>,java.util.Map<Tuple2<java.lang.Boolean,java.lang.Boolean>,DefaultBeanIntrospector.BeanClassInfo>> beaninfos
The cache for saving time for multiple lookups.
-
-
Method Detail
-
getBeanConstructor
public java.lang.invoke.MethodHandle getBeanConstructor(java.lang.Class<?> clazz, boolean includemethods, boolean includefields)
Get the bean constructor for a specific clazz.- Specified by:
getBeanConstructor
in interfaceIBeanIntrospector
-
getBeanProperties
public java.util.Map<java.lang.String,BeanProperty> getBeanProperties(java.lang.Class<?> clazz, boolean includemethods, boolean includefields)
Get the bean properties for a specific clazz.- Specified by:
getBeanProperties
in interfaceIBeanIntrospector
- Parameters:
clazz
- The class to inspect.- Returns:
- The map of properties (name -> BeanProperty).
-
getBeanClassInfo
protected DefaultBeanIntrospector.BeanClassInfo getBeanClassInfo(java.lang.Class<?> clazz, boolean includemethods, boolean includefields)
-
createBeanProperty
protected BeanProperty createBeanProperty(java.lang.String name, java.lang.Class<?> type, java.lang.reflect.Method getter, java.lang.reflect.Method setter, java.lang.Class<?> settertype, java.lang.reflect.Type generictype)
Creates a bean property based on getter/setter.- Parameters:
name
- Property nametype
- Property type.getter
- The getter method.setter
- The setter method.settertype
- The type used by the setter.- Returns:
- The bean property.
-
createBeanProperty
protected BeanProperty createBeanProperty(java.lang.String name, java.lang.reflect.Field field, boolean anonclass)
Creates a bean property based on a field.- Parameters:
name
- Property namefield
- The field.- Returns:
- The bean property.
-
-