Class FieldProperty

java.lang.Object
nl.tudelft.simulation.introspection.AbstractProperty
nl.tudelft.simulation.introspection.fields.FieldProperty
All Implemented Interfaces:
Property

public class FieldProperty extends AbstractProperty implements Property
The field implementation of the Property interface. See for details.

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.
  • Constructor Details

    • FieldProperty

      public FieldProperty(Object owner, Field descriptor, boolean editable)
      constructs a new FieldProperty.
      Parameters:
      owner - Object; its owner
      descriptor - Field; the descriptor
      editable - boolean; is the property editable
    • FieldProperty

      public FieldProperty(Object owner, Field descriptor)
      constructs a new FieldProperty.
      Parameters:
      owner - Object; its owner
      descriptor - Field; the descriptor
  • Method Details

    • getName

      public String getName()
      Retrieves the name of the property.
      Specified by:
      getName in interface Property
      Returns:
      The name of the property
    • getType

      public Class<?> getType()
      Returns the type of this property's value.
      Specified by:
      getType in interface Property
      Returns:
      A {see java.lang.Class}instance denoting the type of this property.
    • setRegularValue

      public void setRegularValue(Object value)
      Method used to set a regular (i.e. not-composite) property value.
      Specified by:
      setRegularValue in class AbstractProperty
      Parameters:
      value - Object; the new value
    • getValue

      public Object getValue()
      Returns the current value of this property.
      Specified by:
      getValue in interface Property
      Returns:
      The current value of this property.
    • getInstance

      public Object getInstance()
      Retrieves the introspected object, which contains this Property.
      Specified by:
      getInstance in interface Property
      Returns:
      the instance
    • isEditable

      public boolean isEditable()
      Returns whether the value of this property may be altered.
      Specified by:
      isEditable in interface Property
      Returns:
      'True', when this property's value can be altered, 'false' otherwise.