Package weka.core.metastore
Class XMLFileBasedMetaStore
- java.lang.Object
-
- weka.core.metastore.XMLFileBasedMetaStore
-
- All Implemented Interfaces:
MetaStore
public class XMLFileBasedMetaStore extends java.lang.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: 14281 $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.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(java.lang.String storeName)Create a named storejava.lang.ObjectgetEntry(java.lang.String storeName, java.lang.String name, java.lang.Class<?> clazz)Get a named entry from the storejava.util.Set<java.lang.String>listMetaStoreEntries(java.lang.String storeName)Get a list of all entries in a named storejava.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 prefixjava.util.Set<java.lang.String>listMetaStores()Get a list of all named meta storesvoidstoreEntry(java.lang.String storeName, java.lang.String name, java.lang.Object toStore)Store a named entry
-
-
-
Method Detail
-
listMetaStores
public java.util.Set<java.lang.String> listMetaStores() throws java.io.IOExceptionDescription copied from interface:MetaStoreGet a list of all named meta stores- Specified by:
listMetaStoresin interfaceMetaStore- 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.IOExceptionDescription 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:
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.IOExceptionDescription 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:
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.IOExceptionDescription 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:
java.io.IOException- if the deserialized entry does not match the expected class
-
createStore
public void createStore(java.lang.String storeName) throws java.io.IOExceptionDescription copied from interface:MetaStoreCreate a named store- Specified by:
createStorein interfaceMetaStore- 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.IOExceptionDescription 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:
java.io.IOException- if a problem occurs
-
-