nl.tudelft.simulation.introspection
Class AbstractProperty

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

public abstract class AbstractProperty
extends Object
implements Property

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

(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

Constructor Summary
AbstractProperty()
           
 
Method Summary
 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(Object value)
          Method used to set a regular (i.e.
 void setValue(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(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(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 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-2011 Delft University of Technology, the Netherlands. All Rights Reserved.