nl.tudelft.simulation.introspection
Interface Property

All Known Implementing Classes:
AbstractProperty, BeanProperty, CollectionTableModel.CollectionProperty, 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 2003-2004 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: General Public License (GPL) , no warranty

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

Method Summary
 java.lang.Class getComponentType()
          Returns the type of the collection components contained in this Property.
 java.lang.Object getInstance()
          Retrieves the introspected object, which contains this Property.
 java.lang.String getName()
          Retrieves the name of the property.
 java.lang.Class getType()
          Returns the type of this property's value.
 java.lang.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(java.lang.Object value)
          Set the value of this property.
 

Method Detail

getName

public java.lang.String getName()
Retrieves the name of the property.

Returns:
The name of the property

getType

public java.lang.Class getType()
Returns the type of this property's value.

Returns:
A {see java.lang.Class}instance denoting the type of this property.

isEditable

public 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

public void setValue(java.lang.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

public java.lang.Object getValue()
Returns the current value of this property.

Returns:
The current value of this property.

getInstance

public java.lang.Object getInstance()
Retrieves the introspected object, which contains this Property.

Returns:
the instance

isCollection

public 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

public java.lang.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-2004 Delft University of Technology, the Netherlands. All Rights Reserved.