weka.gui.beans

## Class XMLFileBasedKFMetaStore

- java.lang.Object
- - weka.gui.beans.XMLFileBasedKFMetaStore

- All Implemented Interfaces:
    KFMetaStore

      public class XMLFileBasedKFMetaStore
      extends java.lang.Object
      implements KFMetaStore

  A simple default implementation of KFMetaStore that uses Weka's XML serialization mechanism to persist entries as XML files in ${WEKA_HOME}/kfMetaStore
  Version:
    $Revision: 11145 $
  Author:
    Mark Hall (mhall{[at]}pentaho{[dot]}com)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DEFAULT_STORE_LOCATION` The default location for the XML files

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XMLFileBasedKFMetaStore()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `createStore(java.lang.String storeName)` Create a named store
    `java.lang.Object` | `getEntry(java.lang.String storeName, java.lang.String name, java.lang.Class<?> clazz)` Get a named entry from the store
    `java.util.Set<java.lang.String>` | `listMetaStoreEntries(java.lang.String storeName)` Get a list of all entries in a named store
    `java.util.Set<java.lang.String>` | `listMetaStoreEntries(java.lang.String storeName, java.lang.String prefix)` Get a list of all named entries starting with the given prefix
    `java.util.Set<java.lang.String>` | `listMetaStores()` Get a list of all named meta stores
    `void` | `storeEntry(java.lang.String storeName, java.lang.String name, java.lang.Object toStore)` Store a named entry

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

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

- - ### Field Detail

    - #### DEFAULT_STORE_LOCATION

          public static final java.lang.String DEFAULT_STORE_LOCATION

      The default location for the XML files

  - ### Constructor Detail

    - #### XMLFileBasedKFMetaStore

          public XMLFileBasedKFMetaStore()

  - ### Method Detail

    - #### listMetaStores

          public java.util.Set<java.lang.String> listMetaStores()
                                                         throws java.io.IOException

      Description copied from interface: `KFMetaStore`
      Get a list of all named meta stores
      Specified by:
        `listMetaStores` in interface `KFMetaStore`
      Returns:
        a list of meta stores
      Throws:
        `java.io.IOException` - if a problem occurs

    - #### listMetaStoreEntries

          public java.util.Set<java.lang.String> listMetaStoreEntries(java.lang.String storeName)
                                                               throws java.io.IOException

      Description copied from interface: `KFMetaStore`
      Get a list of all entries in a named store
      Specified by:
        `listMetaStoreEntries` in interface `KFMetaStore`
      Parameters:
        `storeName` - the name of the store to get entries for
      Returns:
        a list of all entries in the named store
      Throws:
        `java.io.IOException` - if a problem occurs

    - #### listMetaStoreEntries

          public java.util.Set<java.lang.String> listMetaStoreEntries(java.lang.String storeName,
                                                             java.lang.String prefix)
                                                               throws java.io.IOException

      Description copied from interface: `KFMetaStore`
      Get a list of all named entries starting with the given prefix
      Specified by:
        `listMetaStoreEntries` in interface `KFMetaStore`
      Parameters:
        `storeName` - the name of the store to get entries for
        `prefix` - the prefix with which to search for entries
      Returns:
        a list of entries
      Throws:
        `java.io.IOException` - if a problem occurs

    - #### getEntry

          public java.lang.Object getEntry(java.lang.String storeName,
                                  java.lang.String name,
                                  java.lang.Class<?> clazz)
                                    throws java.io.IOException

      Description copied from interface: `KFMetaStore`
      Get a named entry from the store
      Specified by:
        `getEntry` in interface `KFMetaStore`
      Parameters:
        `storeName` - the name of the store to use
        `name` - the full name of the entry to retrieve
        `clazz` - the expected class of the entry when deserialized
      Returns:
        the deserialized entry or null if the name does not exist in the store
      Throws:
        `java.io.IOException` - if the deserialized entry does not match the expected class

    - #### createStore

          public void createStore(java.lang.String storeName)
                           throws java.io.IOException

      Description copied from interface: `KFMetaStore`
      Create a named store
      Specified by:
        `createStore` in interface `KFMetaStore`
      Parameters:
        `storeName` - the name of the store to create
      Throws:
        `java.io.IOException` - if a problem occurs

    - #### storeEntry

          public void storeEntry(java.lang.String storeName,
                        java.lang.String name,
                        java.lang.Object toStore)
                          throws java.io.IOException

      Description copied from interface: `KFMetaStore`
      Store a named entry
      Specified by:
        `storeEntry` in interface `KFMetaStore`
      Parameters:
        `storeName` - the name of the store to use
        `name` - the full name of the entry to store
        `toStore` - a beans compliant object to store
      Throws:
        `java.io.IOException` - if a problem occurs