Package weka.core.metastore
Class XMLFileBasedMetaStore
- java.lang.Object
-
- weka.core.metastore.XMLFileBasedMetaStore
-
- All Implemented Interfaces:
MetaStore
public class XMLFileBasedMetaStore extends Object implements MetaStore
A simple default implementation of MetaStore that uses Weka's XML serialization mechanism to persist entries as XML files in ${WEKA_HOME}/wekaMetaStore- Version:
- $Revision$
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_STORE_LOCATIONThe default location for the XML files
-
Constructor Summary
Constructors Constructor Description XMLFileBasedMetaStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateStore(String storeName)Create a named storeObjectgetEntry(String storeName, String name, Class<?> clazz)Get a named entry from the storeSet<String>listMetaStoreEntries(String storeName)Get a list of all entries in a named storeSet<String>listMetaStoreEntries(String storeName, String prefix)Get a list of all named entries starting with the given prefixSet<String>listMetaStores()Get a list of all named meta storesvoidstoreEntry(String storeName, String name, Object toStore)Store a named entry
-
-
-
Field Detail
-
DEFAULT_STORE_LOCATION
public static final String DEFAULT_STORE_LOCATION
The default location for the XML files
-
-
Method Detail
-
listMetaStores
public Set<String> listMetaStores() throws IOException
Description copied from interface:MetaStoreGet a list of all named meta stores- Specified by:
listMetaStoresin interfaceMetaStore- Returns:
- a list of meta stores
- Throws:
IOException- if a problem occurs
-
listMetaStoreEntries
public Set<String> listMetaStoreEntries(String storeName) throws IOException
Description copied from interface:MetaStoreGet a list of all entries in a named store- Specified by:
listMetaStoreEntriesin interfaceMetaStore- Parameters:
storeName- the name of the store to get entries for- Returns:
- a list of all entries in the named store
- Throws:
IOException- if a problem occurs
-
listMetaStoreEntries
public Set<String> listMetaStoreEntries(String storeName, String prefix) throws IOException
Description copied from interface:MetaStoreGet a list of all named entries starting with the given prefix- Specified by:
listMetaStoreEntriesin interfaceMetaStore- Parameters:
storeName- the name of the store to get entries forprefix- the prefix with which to search for entries- Returns:
- a list of entries
- Throws:
IOException- if a problem occurs
-
getEntry
public Object getEntry(String storeName, String name, Class<?> clazz) throws IOException
Description copied from interface:MetaStoreGet a named entry from the store- Specified by:
getEntryin interfaceMetaStore- Parameters:
storeName- the name of the store to usename- the full name of the entry to retrieveclazz- the expected class of the entry when deserialized- Returns:
- the deserialized entry or null if the name does not exist in the store
- Throws:
IOException- if the deserialized entry does not match the expected class
-
createStore
public void createStore(String storeName) throws IOException
Description copied from interface:MetaStoreCreate a named store- Specified by:
createStorein interfaceMetaStore- Parameters:
storeName- the name of the store to create- Throws:
IOException- if a problem occurs
-
storeEntry
public void storeEntry(String storeName, String name, Object toStore) throws IOException
Description copied from interface:MetaStoreStore a named entry- Specified by:
storeEntryin interfaceMetaStore- Parameters:
storeName- the name of the store to usename- the full name of the entry to storetoStore- a beans compliant object to store- Throws:
IOException- if a problem occurs
-
-