Interface Property
-
- All Known Implementing Classes:
AbstractProperty,BeanProperty,FieldProperty
public interface PropertyA property defines a characteristic of an object. It has a name, a type and provides methods to view and alter its value. Different introspection implementation may provide different definitions for what exactly are regarded to be the 'properties' of an object.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.
-
-
Method Summary
All Methods Instance Methods Abstract 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.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.voidsetValue(Object value)Set the value of this property.
-
-
-
Method Detail
-
getName
String getName()
Retrieves the name of the property.- Returns:
- The name of the property
-
getType
Class<?> getType()
Returns the type of this property's value.- Returns:
- A {see java.lang.Class}instance denoting the type of this property.
-
isEditable
boolean isEditable()
Returns whether the value of this property may be altered.- Returns:
- 'True', when this property's value can be altered, 'false' otherwise.
-
setValue
void setValue(Object value)
Set the value of this property. However, if isEditable() returns 'false', the value of this property will not be altered. Composite property values (i.e. {see java.util.Collection}or arrays) should be provided as an instance of {see java.util.Collection}.- Parameters:
value- Object; The new value of this property.
-
getValue
Object getValue()
Returns the current value of this property.- Returns:
- The current value of this property.
-
getInstance
Object getInstance()
Retrieves the introspected object, which contains this Property.- Returns:
- the instance
-
getComposedType
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.- Returns:
- the CollectionTypeEnum of this Property.
-
getComponentType
Class<?> getComponentType()
Returns the type of the collection components contained in this Property.- 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.
-
-