Class BasicBean

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    AbstractListBean

    public class BasicBean
    extends java.lang.Object
    implements java.io.Serializable
    Bean that provides basic support for Java beans. Classes that want to provide bean support can either extend this class or copy the relevant code.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      BasicBean()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addPropertyChangeListener​(java.beans.PropertyChangeListener listener)
      Adds a PropertyChangeListener to the listener list.
      void addPropertyChangeListener​(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
      Adds a PropertyChangeListener to the listener list for a specific property.
      protected void firePropertyChange​(java.beans.PropertyChangeEvent event)
      Reports a bound property change.
      protected void firePropertyChange​(java.lang.String propertyName, boolean oldValue, boolean newValue)
      Support for reporting bound property changes for boolean properties.
      protected void firePropertyChange​(java.lang.String propertyName, byte oldValue, byte newValue)
      Reports a bound property change.
      protected void firePropertyChange​(java.lang.String propertyName, char oldValue, char newValue)
      Reports a bound property change.
      protected void firePropertyChange​(java.lang.String propertyName, double oldValue, double newValue)
      Reports a bound property change.
      protected void firePropertyChange​(java.lang.String propertyName, float oldValue, float newValue)
      Reports a bound property change.
      protected void firePropertyChange​(java.lang.String propertyName, int oldValue, int newValue)
      Support for reporting bound property changes for integer properties.
      protected void firePropertyChange​(java.lang.String propertyName, long oldValue, long newValue)
      Reports a bound property change.
      protected void firePropertyChange​(java.lang.String propertyName, short oldValue, short newValue)
      Reports a bound property change.
      protected void firePropertyChange​(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
      Support for reporting bound property changes for Object properties.
      java.beans.PropertyChangeListener[] getPropertyChangeListeners()
      Returns an array of all the property change listeners registered on this component.
      java.beans.PropertyChangeListener[] getPropertyChangeListeners​(java.lang.String propertyName)
      Returns an array of all the listeners which have been associated with the named property.
      void removePropertyChangeListener​(java.beans.PropertyChangeListener listener)
      Removes a PropertyChangeListener from the listener list.
      void removePropertyChangeListener​(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
      Removes a PropertyChangeListener from the listener list for a specific property.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BasicBean

        public BasicBean()
    • Method Detail

      • firePropertyChange

        protected void firePropertyChange​(java.lang.String propertyName,
                                          java.lang.Object oldValue,
                                          java.lang.Object newValue)
        Support for reporting bound property changes for Object properties. This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.
        Parameters:
        propertyName - the property whose value has changed
        oldValue - the property's previous value
        newValue - the property's new value
      • firePropertyChange

        protected void firePropertyChange​(java.lang.String propertyName,
                                          boolean oldValue,
                                          boolean newValue)
        Support for reporting bound property changes for boolean properties. This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.
        Parameters:
        propertyName - the property whose value has changed
        oldValue - the property's previous value
        newValue - the property's new value
      • firePropertyChange

        protected void firePropertyChange​(java.lang.String propertyName,
                                          int oldValue,
                                          int newValue)
        Support for reporting bound property changes for integer properties. This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.
        Parameters:
        propertyName - the property whose value has changed
        oldValue - the property's previous value
        newValue - the property's new value
      • firePropertyChange

        protected void firePropertyChange​(java.lang.String propertyName,
                                          byte oldValue,
                                          byte newValue)
        Reports a bound property change.
        Parameters:
        propertyName - the programmatic name of the property that was changed
        oldValue - the old value of the property (as a byte)
        newValue - the new value of the property (as a byte)
        See Also:
        firePropertyChange(String, Object, Object)
      • firePropertyChange

        protected void firePropertyChange​(java.lang.String propertyName,
                                          char oldValue,
                                          char newValue)
        Reports a bound property change.
        Parameters:
        propertyName - the programmatic name of the property that was changed
        oldValue - the old value of the property (as a char)
        newValue - the new value of the property (as a char)
        See Also:
        firePropertyChange(String, Object, Object)
      • firePropertyChange

        protected void firePropertyChange​(java.lang.String propertyName,
                                          short oldValue,
                                          short newValue)
        Reports a bound property change.
        Parameters:
        propertyName - the programmatic name of the property that was changed
        oldValue - the old value of the property (as a short)
        newValue - the old value of the property (as a short)
        See Also:
        firePropertyChange(String, Object, Object)
      • firePropertyChange

        protected void firePropertyChange​(java.lang.String propertyName,
                                          long oldValue,
                                          long newValue)
        Reports a bound property change.
        Parameters:
        propertyName - the programmatic name of the property that was changed
        oldValue - the old value of the property (as a long)
        newValue - the new value of the property (as a long)
        Since:
        1.5
        See Also:
        firePropertyChange(String, Object, Object)
      • firePropertyChange

        protected void firePropertyChange​(java.lang.String propertyName,
                                          float oldValue,
                                          float newValue)
        Reports a bound property change.
        Parameters:
        propertyName - the programmatic name of the property that was changed
        oldValue - the old value of the property (as a float)
        newValue - the new value of the property (as a float)
        Since:
        1.5
        See Also:
        firePropertyChange(String, Object, Object)
      • firePropertyChange

        protected void firePropertyChange​(java.lang.String propertyName,
                                          double oldValue,
                                          double newValue)
        Reports a bound property change.
        Parameters:
        propertyName - the programmatic name of the property that was changed
        oldValue - the old value of the property (as a double)
        newValue - the new value of the property (as a double)
        See Also:
        firePropertyChange(String, Object, Object)
      • firePropertyChange

        protected void firePropertyChange​(java.beans.PropertyChangeEvent event)
        Reports a bound property change.
        Parameters:
        event - the event reporting the property change.
        See Also:
        firePropertyChange(String, Object, Object)