de.kleopatra.persistence
Class AbstractIOHandler

java.lang.Object
  extended byde.kleopatra.persistence.AbstractIOHandler
All Implemented Interfaces:
IOHandler
Direct Known Subclasses:
FormDescriptionIOHandler, LayoutDescriptionIOHandler, ObjectIOHandler, PresentationIOHandler, StyleMapIOHandler

public abstract class AbstractIOHandler
extends java.lang.Object
implements IOHandler

IOHandler that uses the default XMLEncoder/XMLDecoder.

Version:
$Revision: 1.2 $ - $Date: 2004/09/30 10:15:13 $
Author:
(C) Jeanette Winzenburg, Berlin

Constructor Summary
AbstractIOHandler()
           
 
Method Summary
protected abstract  boolean checkType(java.lang.Object object)
          checks and returns whether type of object is compatible with getHandledType.
 java.lang.String ensureExtension(java.lang.String filename)
          returns the given filename with getFileExtension.
protected  int getExtensionPosition(java.lang.String filename)
           
 java.lang.Object read(java.lang.String filename)
          read on object of type getHandledClass() to file with filename returns null if object's type is incompatible or an error occured.
 java.lang.Object readResource(java.lang.String resourceName, java.lang.Class targetClass)
          read on object of type getHandledClass() to file with filename returns null if object's type is incompatible or an error occured.
 void write(java.lang.Object object, java.lang.String filename)
          tries to write the given object to a file with filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.kleopatra.persistence.IOHandler
getDescription, getExtension, getHandledClass
 

Constructor Detail

AbstractIOHandler

public AbstractIOHandler()
Method Detail

write

public void write(java.lang.Object object,
                  java.lang.String filename)
Description copied from interface: IOHandler
tries to write the given object to a file with filename. if object's type is incompatible or an error occurs nothing is done PENDING: use exceptions in production version?

Specified by:
write in interface IOHandler

read

public java.lang.Object read(java.lang.String filename)
Description copied from interface: IOHandler
read on object of type getHandledClass() to file with filename returns null if object's type is incompatible or an error occured.

Specified by:
read in interface IOHandler

readResource

public java.lang.Object readResource(java.lang.String resourceName,
                                     java.lang.Class targetClass)
Description copied from interface: IOHandler
read on object of type getHandledClass() to file with filename returns null if object's type is incompatible or an error occured.

Specified by:
readResource in interface IOHandler
Parameters:
resourceName -
targetClass - class to use for resolving relative resource location locations are resolved as defined by ResourceManager.

ensureExtension

public java.lang.String ensureExtension(java.lang.String filename)
Description copied from interface: IOHandler
returns the given filename with getFileExtension.

Specified by:
ensureExtension in interface IOHandler

checkType

protected abstract boolean checkType(java.lang.Object object)
checks and returns whether type of object is compatible with getHandledType.


getExtensionPosition

protected int getExtensionPosition(java.lang.String filename)


Copyright © 2003, 2004 SwingEmpire Jeanette Winzenburg. All Rights Reserved.