org.flexdock.perspective.persist

## Class FilePersistenceHandler

- java.lang.Object
- - org.flexdock.perspective.persist.FilePersistenceHandler

- All Implemented Interfaces:
    PersistenceHandler

      public class FilePersistenceHandler
      extends java.lang.Object
      implements PersistenceHandler

  Created on 2005-06-03
  Version:
    $Id: FilePersistenceHandler.java,v 1.9 2006-12-20 20:55:22 kschaefe Exp $
  Author:
    Mateusz Szczap

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.io.File` | `DEFAULT_PERSPECTIVE_DIR`
    `protected java.io.File` | `defaultPerspectiveFile`
    `protected Persister` | `m_persister`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FilePersistenceHandler(java.io.File file)`
    `FilePersistenceHandler(java.io.File defaultFile, Persister persister)`
    `FilePersistenceHandler(java.lang.String absolutePath)`
    `FilePersistenceHandler(java.lang.String absolutePath, Persister persister)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static FilePersistenceHandler` | `createDefault(java.lang.String fileName)`
    `Persister` | `createDefaultPersister()`
    `java.io.File` | `getPerspectiveFile(java.lang.String persistenceKey)`
    `PerspectiveModel` | `load(java.lang.String persistenceKey)`
    `void` | `setDefaultPerspectiveFile(java.io.File file)`
    `void` | `setDefaultPerspectiveFile(java.lang.String absolutePath)`
    `boolean` | `store(java.lang.String persistenceKey, PerspectiveModel perspectiveModel)`
    `protected void` | `validatePerspectiveFile(java.io.File file)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_PERSPECTIVE_DIR

          public static final java.io.File DEFAULT_PERSPECTIVE_DIR

    - #### defaultPerspectiveFile

          protected java.io.File defaultPerspectiveFile

    - #### m_persister

          protected Persister m_persister

  - ### Constructor Detail

    - #### FilePersistenceHandler

          public FilePersistenceHandler(java.lang.String absolutePath)

    - #### FilePersistenceHandler

          public FilePersistenceHandler(java.io.File file)

    - #### FilePersistenceHandler

          public FilePersistenceHandler(java.lang.String absolutePath,
                                Persister persister)

    - #### FilePersistenceHandler

          public FilePersistenceHandler(java.io.File defaultFile,
                                Persister persister)

  - ### Method Detail

    - #### createDefault

          public static FilePersistenceHandler createDefault(java.lang.String fileName)

    - #### store

          public boolean store(java.lang.String persistenceKey,
                      PerspectiveModel perspectiveModel)
                        throws java.io.IOException,
                               PersistenceException

      Specified by:
        `store` in interface `PersistenceHandler`
      Throws:
        `java.io.IOException`
        `PersistenceException`

    - #### load

          public PerspectiveModel load(java.lang.String persistenceKey)
                                throws java.io.IOException,
                                       PersistenceException

      Specified by:
        `load` in interface `PersistenceHandler`
      Throws:
        `java.io.IOException`
        `PersistenceException`

    - #### validatePerspectiveFile

          protected void validatePerspectiveFile(java.io.File file)
                                          throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getPerspectiveFile

          public java.io.File getPerspectiveFile(java.lang.String persistenceKey)

    - #### setDefaultPerspectiveFile

          public void setDefaultPerspectiveFile(java.io.File file)

    - #### setDefaultPerspectiveFile

          public void setDefaultPerspectiveFile(java.lang.String absolutePath)

    - #### createDefaultPersister

          public Persister createDefaultPersister()

      Specified by:
        `createDefaultPersister` in interface `PersistenceHandler`