nl.tudelft.simulation.introspection
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.

(c) copyright 2002-2005-2004 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.

Since:
1.4
Version:
1.1 Apr 15, 2004
Author:
Niels Lang Peter Jacobs

Method Summary
 Class getComponentType()
          Returns the type of the collection components contained in this Property.
 Object getInstance()
          Retrieves the introspected object, which contains this Property.
 String getName()
          Retrieves the name of the property.
 Class getType()
          Returns the type of this property's value.
 Object getValue()
          Returns the current value of this property.
 boolean isCollection()
          Returns whether the contained value is a collection (i.e.
 boolean isEditable()
          Returns whether the value of this property may be altered.
 void setValue(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 - 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

isCollection

boolean isCollection()
Returns whether the contained value is a collection (i.e. is a composite value). The definition whether a value is considered composite depends on the property paradigm used by this Property.

Returns:
true, if the contained value is a collection, false otherwise.

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.


Copyright © 2002-2011 Delft University of Technology, the Netherlands. All Rights Reserved.