Class AlbumObjectProperties

  • Direct Known Subclasses:
    AOP

    public class AlbumObjectProperties
    extends java.lang.Object
    The recommended way to store properties per album object, be it files or directories Relies on XML serialization of a Map of name, value pairs Values may be any Java object adhering to the JavaBeans specification. Object graphs of JavaBean objects may be passed as value
    Since:
    8.0
    • Constructor Detail

      • AlbumObjectProperties

        public AlbumObjectProperties​(java.io.File f)
        To support use of this class from FastFile without need for AlbumObject
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • addPropertyChangeListener

        public void addPropertyChangeListener​(java.beans.PropertyChangeListener listener)
      • removePropertyChangeListener

        public void removePropertyChangeListener​(java.beans.PropertyChangeListener listener)
        Removes a PropertyChangeListener from the listener list. This method should be used to remove PropertyChangeListeners that were registered for all bound properties of this class.

        If listener is null, no exception is thrown and no action is performed.

        Parameters:
        listener - the PropertyChangeListener to be removed
        See Also:
        addPropertyChangeListener(java.beans.PropertyChangeListener)
      • addPropertyChangeListener

        public void addPropertyChangeListener​(java.lang.String propertyName,
                                              java.beans.PropertyChangeListener listener)
      • 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
      • get

        public java.lang.Object get​(java.lang.String key)
      • get

        public <T> T get​(java.lang.String key,
                         T def)
      • put

        public java.lang.Object put​(java.lang.String key,
                                    java.lang.Object value)
        Associate a property with a certain key
        Parameters:
        key - String, name describing the property
        value - Object, any Object implementing JavaBeans specification
        Returns:
        Previous associated value
      • putHidden

        public java.lang.Object putHidden​(java.lang.String key,
                                          java.lang.Object value)
      • remove

        public java.lang.Object remove​(java.lang.String key)
      • containsKey

        public boolean containsKey​(java.lang.String key)
      • keySet

        public java.util.Set<java.lang.String> keySet()
        Returns:
        keys for all non-hidden properties
      • save

        public boolean save​(boolean preserveLastModified)
        Store all properties to disk Makes AlbumObject fire a "properties" change event
        Parameters:
        preserveLastModified - preserve the last modified date of the backing .info file
        Returns:
        true if properties were actually stored
        See Also:
        for version that throws exception in case of problems
      • store

        public void store​(boolean preserveLastModified)
                   throws java.io.FileNotFoundException
        Store all properties to disk Makes AlbumObject fire a "properties" change event
        Parameters:
        preserveLastModified - preserve the last modified date of the backing .info file
        Throws:
        java.io.FileNotFoundException - in case properties can't be stored
        Since:
        13
      • store

        public void store()
                   throws java.io.FileNotFoundException
        Save properties but leave last modification date preserved
        Throws:
        java.io.FileNotFoundException
        Since:
        13
      • save

        public boolean save()
        Save properties but leave last modification date preserved
        Returns:
      • getFile

        public java.io.File getFile()
        Get file associated with this AlbumObjectProperty object
        Returns:
        Property file
      • getPropertyFile

        public static java.io.File getPropertyFile​(java.io.File f)
      • loadUI

        public void loadUI​(JComponentHolder ui)
        Load UI controls with values from this object
        Since:
        8.2
      • saveUI

        public void saveUI​(JComponentHolder ui)
                    throws java.io.FileNotFoundException
        Save values of UI controls to this object
        Throws:
        java.io.FileNotFoundException
        Since:
        8.2