Class DefaultBeanIntrospector
java.lang.Object
jadex.common.transformation.traverser.DefaultBeanIntrospector
- All Implemented Interfaces:
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 ClassesModifier and TypeClassDescriptionprotected static class
Infos about a bean class. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new introspector.DefaultBeanIntrospector
(int lrusize) Create a new introspector. -
Method Summary
Modifier and TypeMethodDescriptionprotected BeanProperty
createBeanProperty
(String name, Class<?> type, Method getter, Method setter, Class<?> settertype, Type generictype) Creates a bean property based on getter/setter.protected BeanProperty
createBeanProperty
(String name, Field field, boolean anonclass) Creates a bean property based on a field.protected DefaultBeanIntrospector.BeanClassInfo
getBeanClassInfo
(Class<?> clazz, boolean includemethods, boolean includefields) getBeanConstructor
(Class<?> clazz, boolean includemethods, boolean includefields) Get the bean constructor for a specific clazz.getBeanProperties
(Class<?> clazz, boolean includemethods, boolean includefields) Get the bean properties for a specific clazz.
-
Field Details
-
beaninfos
protected jadex.collection.LRU<jadex.collection.WeakObject<Class<?>>,Map<jadex.common.Tuple2<Boolean, beaninfosBoolean>, DefaultBeanIntrospector.BeanClassInfo>> The cache for saving time for multiple lookups.
-
-
Constructor Details
-
DefaultBeanIntrospector
public DefaultBeanIntrospector()Create a new introspector. -
DefaultBeanIntrospector
public DefaultBeanIntrospector(int lrusize) Create a new introspector.
-
-
Method Details
-
getBeanConstructor
public MethodHandle getBeanConstructor(Class<?> clazz, boolean includemethods, boolean includefields) Get the bean constructor for a specific clazz.- Specified by:
getBeanConstructor
in interfaceIBeanIntrospector
-
getBeanProperties
public Map<String,BeanProperty> getBeanProperties(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(Class<?> clazz, boolean includemethods, boolean includefields) -
createBeanProperty
protected BeanProperty createBeanProperty(String name, Class<?> type, Method getter, Method setter, Class<?> settertype, 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
Creates a bean property based on a field.- Parameters:
name
- Property namefield
- The field.- Returns:
- The bean property.
-