Package jmri

Class NamedBeanPropertyDescriptor<E>

java.lang.Object
jmri.NamedBeanPropertyDescriptor<E>
Type Parameters:
E - class of describer, e.g. Boolean.class
Direct Known Subclasses:
BooleanPropertyDescriptor, SelectionPropertyDescriptor

public abstract class NamedBeanPropertyDescriptor<E> extends Object
Describes metadata about a given property key for a NamedBean.

This metadata is used by the BeanTable actions to display and edit the properties in question.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final E
    What should be displayed when a given Bean does not have this property set.
    final String
    Key of the property, to be used in the setProperty and getProperty functions on the NamedBean.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    NamedBeanPropertyDescriptor(String propertyKey, E defaultValue)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Equals based on Property Key and Default value Class.
    abstract String
    Return user-visible text to render as a column header for the BeanTable representing this setting.
    Get the Class of the property.
    int
    hashCode based on Property Key and Default value Class.
    abstract boolean
    Determines whether this property is editable.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • propertyKey

      public final String propertyKey
      Key of the property, to be used in the setProperty and getProperty functions on the NamedBean.
    • defaultValue

      public final E defaultValue
      What should be displayed when a given Bean does not have this property set.
  • Constructor Details

  • Method Details

    • getColumnHeaderText

      public abstract String getColumnHeaderText()
      Return user-visible text to render as a column header for the BeanTable representing this setting.
      Returns:
      localized string
    • isEditable

      public abstract boolean isEditable(NamedBean bean)
      Determines whether this property is editable.
      Parameters:
      bean - the Bean object of the given row.
      Returns:
      true for editable, false for disabled.
    • getValueClass

      public Class<?> getValueClass()
      Get the Class of the property.

      This class is used to find a matching Renderer for the BeanTable column to display and edit the value of this property. For example returning Boolean.class will show a checkbox.

      Returns:
      Class for the property values.
    • equals

      public boolean equals(Object obj)
      Equals based on Property Key and Default value Class.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      hashCode based on Property Key and Default value Class.
      Overrides:
      hashCode in class Object