Class AbstractProperty
- java.lang.Object
-
- nl.tudelft.simulation.introspection.AbstractProperty
-
- All Implemented Interfaces:
Property
- Direct Known Subclasses:
BeanProperty,FieldProperty
public abstract class AbstractProperty extends Object implements Property
A default Property implementation that provides a standard way to handle composite values.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 AbstractProperty()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Class<?>getComponentType()Returns the type of the collection components contained in this Property.ComposedTypeEnumgetComposedType()Returns the collection type of the contained value (i.e.protected abstract voidsetRegularValue(Object value)Method used to set a regular (i.e.voidsetValue(Object value)Basic 'setValue' implementation.StringtoString()-
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
-
-
-
-
Method Detail
-
setValue
public void setValue(Object value)
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.- Specified by:
setValuein interfaceProperty- Parameters:
value- Object; The new value of this property.- See Also:
Property.setValue(java.lang.Object)
-
setRegularValue
protected abstract void setRegularValue(Object value)
Method used to set a regular (i.e. not-composite) property value.- Parameters:
value- Object; the new value
-
getComposedType
public ComposedTypeEnum 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:
getComposedTypein interfaceProperty- Returns:
- the CollectionTypeEnum of this Property.
-
getComponentType
public Class<?> getComponentType()
Returns the type of the collection components contained in this Property.- Specified by:
getComponentTypein 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.
-
-