Interface Property
- All Known Implementing Classes:
AbstractProperty
,BeanProperty
,FieldProperty
public interface Property
A 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-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.
-
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).Retrieves the introspected object, which contains this Property.getName()
Retrieves the name of the property.Class<?>
getType()
Returns the type of this property's value.getValue()
Returns the current value of this property.boolean
Returns whether the value of this property may be altered.void
Set the value of this property.
-
Method Details
-
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
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.
-