nl.tudelft.simulation.introspection
Class AbstractProperty

java.lang.Object
  extended bynl.tudelft.simulation.introspection.AbstractProperty
All Implemented Interfaces:
Property
Direct Known Subclasses:
BeanProperty, CollectionTableModel.CollectionProperty, FieldProperty

public abstract class AbstractProperty
extends java.lang.Object
implements Property

A default Property implementation that provides a standard way to handle composite values.

(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

Constructor Summary
AbstractProperty()
           
 
Method Summary
 java.lang.Class getComponentType()
          Returns the type of the collection components contained in this Property.
 boolean isCollection()
          Returns true when the contained value is either an array, or an instance of {see java.util.Collection}, i.e.
protected abstract  void setRegularValue(java.lang.Object value)
          Method used to set a regular (i.e.
 void setValue(java.lang.Object value)
          Basic 'setValue' implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.tudelft.simulation.introspection.Property
getInstance, getName, getType, getValue, isEditable
 

Constructor Detail

AbstractProperty

public AbstractProperty()
Method Detail

setValue

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

Specified by:
setValue in interface Property
Parameters:
value - The new value of this property.
See Also:
Property.setValue(java.lang.Object)

setRegularValue

protected abstract void setRegularValue(java.lang.Object value)
Method used to set a regular (i.e. not-composite) property value.

Parameters:
value - the new value

isCollection

public boolean isCollection()
Returns true when the contained value is either an array, or an instance of {see java.util.Collection}, i.e. is a property with composite value.

Specified by:
isCollection in interface Property
Returns:
true, if the contained value is a collection, false otherwise.
See Also:
Property.isCollection()

getComponentType

public java.lang.Class getComponentType()
Description copied from interface: Property
Returns the type of the collection components contained in this Property.

Specified by:
getComponentType in interface 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.
See Also:
Property.getComponentType()


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