org.base.apps.core.data
Class FileData<D>
java.lang.Object
org.base.apps.util.BaseNameable
org.base.apps.core.data.BaseData<D>
org.base.apps.core.data.FileData<D>
- All Implemented Interfaces:
- ApplicationData<D>, BeanContainer<D>, Nameable, Named
public class FileData<D>
- extends BaseData<D>
Implementation of ApplicationData to support file persistence,
serializing a bean to and from XML, which is written to and read from the
file, respectively.
- Author:
- Kevan Simpson
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.base.apps.util.Named |
getName |
FileData
public FileData()
FileData
public FileData(Class<D> beanType)
load
public void load()
- Specified by:
load in interface ApplicationData<D>- Specified by:
load in class BaseData<D>
- See Also:
BaseData.load()
save
public void save()
- Specified by:
save in interface ApplicationData<D>- Specified by:
save in class BaseData<D>
- See Also:
BaseData.save()
getFilename
public String getFilename()
- Returns:
- the filename
setFilename
public void setFilename(String filename)
- Parameters:
filename - the filename to set
configure
protected void configure(BasePersist persAnnot)
- Specified by:
configure in class BaseData<D>
- See Also:
BaseData.configure(org.base.apps.api.annot.BasePersist)
getDataFile
protected File getDataFile()
loadData
protected D loadData(Class<D> clz)
throws Exception
- Per the application's catalytic
BasePersist annotation, attempts to
load the application's data and, if successful,
setting the data.
- Parameters:
clz - The class of the data to load.
- Returns:
- The loaded data, possibly but unlikely to be
null.
- Throws:
Exception - if an error occurs loading data.
saveData
protected void saveData(D data)
Copyright 2011, Blue Agate Software Entity (BASE)