com.thoughtworks.xstream.persistence
Class AbstractFilePersistenceStrategy
java.lang.Object
com.thoughtworks.xstream.persistence.AbstractFilePersistenceStrategy
- All Implemented Interfaces:
- PersistenceStrategy
- Direct Known Subclasses:
- FilePersistenceStrategy, FileStreamStrategy
public abstract class AbstractFilePersistenceStrategy
- extends Object
- implements PersistenceStrategy
Abstract base class for file based persistence strategies.
- Since:
- 1.3.1
- Author:
- Guilherme Silveira, Joerg Schaible
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractFilePersistenceStrategy
public AbstractFilePersistenceStrategy(File baseDirectory,
XStream xstream,
String encoding)
getConverterLookup
protected ConverterLookup getConverterLookup()
getMapper
protected Mapper getMapper()
isValid
protected boolean isValid(File dir,
String name)
extractKey
protected abstract Object extractKey(String name)
- Given a filename, the unescape method returns the key which originated it.
- Parameters:
name
- the filename
- Returns:
- the original key
getName
protected abstract String getName(Object key)
- Given a key, the escape method returns the filename which shall be used.
- Parameters:
key
- the key
- Returns:
- the desired and escaped filename
put
public Object put(Object key,
Object value)
- Specified by:
put
in interface PersistenceStrategy
iterator
public Iterator iterator()
- Specified by:
iterator
in interface PersistenceStrategy
size
public int size()
- Specified by:
size
in interface PersistenceStrategy
containsKey
public boolean containsKey(Object key)
get
public Object get(Object key)
- Specified by:
get
in interface PersistenceStrategy
remove
public Object remove(Object key)
- Specified by:
remove
in interface PersistenceStrategy
Copyright © 2004-2014 XStream. All Rights Reserved.