Class BeanProperty
- java.lang.Object
-
- nl.tudelft.simulation.introspection.AbstractProperty
-
- nl.tudelft.simulation.introspection.beans.BeanProperty
-
- All Implemented Interfaces:
Property
public class BeanProperty extends AbstractProperty implements Property
The JavaBean TM implementation of the Property interface. See {see BeanIntrospector}for details.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 Modifier Constructor Description protectedBeanProperty(Object bean, PropertyDescriptor descriptor)constructs a new BeanProperty.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetInstance()Retrieves the introspected object, which contains this Property.StringgetName()Retrieves the name of the property.Class<?>getType()Returns the type of this property's value.ObjectgetValue()Returns the current value of this property.booleanisEditable()Returns whether the value of this property may be altered.protected voidsetRegularValue(Object values)Method used to set a regular (i.e.-
Methods inherited from class nl.tudelft.simulation.introspection.AbstractProperty
getComponentType, getComposedType, setValue, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface nl.tudelft.simulation.introspection.Property
getComponentType, getComposedType, setValue
-
-
-
-
Constructor Detail
-
BeanProperty
protected BeanProperty(Object bean, PropertyDescriptor descriptor)
constructs a new BeanProperty.- Parameters:
bean- Object; the bean to introspectdescriptor- PropertyDescriptor; the descriptor of the property
-
-
Method Detail
-
getName
public String getName()
Retrieves the name of the property.
-
getType
public Class<?> getType()
Returns the type of this property's value.
-
setRegularValue
protected void setRegularValue(Object values)
Method used to set a regular (i.e. not-composite) property value.- Specified by:
setRegularValuein classAbstractProperty- Parameters:
values- Object; the new value
-
getValue
public Object getValue()
Returns the current value of this property.
-
getInstance
public Object getInstance()
Retrieves the introspected object, which contains this Property.- Specified by:
getInstancein interfaceProperty- Returns:
- the instance
-
isEditable
public boolean isEditable()
Returns whether the value of this property may be altered.- Specified by:
isEditablein interfaceProperty- Returns:
- 'True', when this property's value can be altered, 'false' otherwise.
-
-