Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

Nested Class Summary
`protected class` | `AbstractFilePersistenceStrategy.ValidFilenameFilter`
`protected class` | `AbstractFilePersistenceStrategy.XmlMapEntriesIterator`

Constructor Summary
`AbstractFilePersistenceStrategy(File baseDirectory, XStream xstream, String encoding)`

Method Summary
`boolean` | `containsKey(Object key)`
`protected abstract Object` | `extractKey(String name)` Given a filename, the unescape method returns the key which originated it.
`Object` | `get(Object key)`
`protected ConverterLookup` | `getConverterLookup()`
`protected Mapper` | `getMapper()`
`protected abstract String` | `getName(Object key)` Given a key, the escape method returns the filename which shall be used.
`protected boolean` | `isValid(File dir, String name)`
`Iterator` | `iterator()`
`Object` | `put(Object key, Object value)`
`Object` | `remove(Object key)`
`int` | `size()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AbstractFilePersistenceStrategy

    public AbstractFilePersistenceStrategy(File baseDirectory,
                                           XStream xstream,
                                           String encoding)

Method Detail

### 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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2008 XStream. All Rights Reserved.