/*
 Formatter.java - interface for writing a Storable object to a physical representation
 
 Copyright  (C) 2004 Hugues Johnson
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
 the GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

package com.huguesjohnson.serialization;

import com.huguesjohnson.serialization.Storable;
import com.huguesjohnson.serialization.StorageException;

/**
 * Formatter - interface for writing a Storable object to a physical representation
 * @author Hugues Johnson
 */
public interface Formatter{
	/**
	 * Saves the object to the output path.
	 * @param object The object to save.
	 * @param outputPath The path to save the object to.
	 * @throws StorageException If the save operation fails for any reason.
	 */
	public void saveTo(Storable object,String outputPath) throws StorageException;

	/**
	 * Loads an object from the specified source path.
	 * @param sourcePath The path to load the object from.
	 * @return The object stored at the specified path.
	 * @throws StorageException If the load operation fails for any reason.
	 */
	public Storable loadFrom(String sourcePath) throws StorageException;
}