Class BeanIntrospector
- java.lang.Object
-
- nl.tudelft.simulation.introspection.beans.BeanIntrospector
-
- All Implemented Interfaces:
Introspector
public class BeanIntrospector extends Object implements Introspector
The Bean introspector provides a simplified JavaBean implementation of the introspection interfaces. Its behavior adheres to the following:- Properties are discovered by searching for 'getter' and / or 'setter' methods
- Property value are manipulated via a property's 'setter' method. If no such method is found, the property cannot be altered
- Indexed properties are probably not correctly supported.
Copyright (c) 2002-2023 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://simulation.tudelft.nl. The DSOL project is distributed under a three-clause BSD-style license, which can be found at https://https://simulation.tudelft.nl/dsol/docs/latest/license.html.
- Since:
- 1.5
- Author:
- Peter Jacobs , Alexander Verbraeck, Niels Lang.
-
-
Constructor Summary
Constructors Constructor Description BeanIntrospector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Property[]getProperties(Object introspectedObject)PropertygetProperty(Object introspectedObject, String property)Retrieves the {see Property}with a given name from an introspected object.String[]getPropertyNames(Object introspectedObject)Retrieves the names of the properties of the introspected object.
-
-
-
Method Detail
-
getProperties
public Property[] getProperties(Object introspectedObject)
- Specified by:
getPropertiesin interfaceIntrospector- Parameters:
introspectedObject- Object; the introspected object- Returns:
- Retrieves properties of the introspected object. The properties' values can themselves be introspectable. An empty array is returned if no introspected object has been set.
-
getProperty
public Property getProperty(Object introspectedObject, String property)
Retrieves the {see Property}with a given name from an introspected object.- Specified by:
getPropertyin interfaceIntrospector- Parameters:
introspectedObject- Object; The introspected object.property- String; The name of the property to be retrieved- Returns:
- A {see Property}instance for the given object and property name.
-
getPropertyNames
public String[] getPropertyNames(Object introspectedObject)
Retrieves the names of the properties of the introspected object.- Specified by:
getPropertyNamesin interfaceIntrospector- Parameters:
introspectedObject- Object; The introspected object.- Returns:
- An unordered array of the introspected object's property names.
-
-