Class AbstractProperty
java.lang.Object
nl.tudelft.simulation.introspection.AbstractProperty
- All Implemented Interfaces:
Property
- Direct Known Subclasses:
BeanProperty
,FieldProperty
A default Property implementation that provides a standard way to handle composite values.
Copyright (c) 2002-2024 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
-
Method Summary
Modifier and TypeMethodDescriptionClass<?>
Returns the type of the collection components contained in this Property.Returns the collection type of the contained value (i.e. a composite value).protected abstract void
setRegularValue
(Object value) Method used to set a regular (i.e. not-composite) property value.void
Basic 'setValue' implementation.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
getInstance, getName, getType, getValue, isEditable
-
Constructor Details
-
AbstractProperty
public AbstractProperty()
-
-
Method Details
-
setValue
Basic 'setValue' implementation. It is checked whether this property contains a composite value. If so, the composite value of this property is updated. Composite values are expected to be supplied as a {see java.util.Collection}. If needed, array conversion takes place. If the property is not composite, the value-setting is delegated to the 'setRegularValue' method. Maps cannot be updated at this moment. -
setRegularValue
Method used to set a regular (i.e. not-composite) property value.- Parameters:
value
- Object; the new value
-
getComposedType
Returns the collection type of the contained value (i.e. a composite value). The definition whether a value is considered composite depends on the property paradigm used by this Property.- Specified by:
getComposedType
in interfaceProperty
- Returns:
- the CollectionTypeEnum of this Property.
-
getComponentType
Returns the type of the collection components contained in this Property.- Specified by:
getComponentType
in interfaceProperty
- Returns:
- The type of the collection components contained in this Property. Returns null when isCollection() returns false, or when the component type could not be determined by this Property.
-
toString
-