Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.common.core.io.project.extension.internal
Class ActionProjectFile

java.lang.Object
  extended by eu.esdihumboldt.hale.common.core.io.project.extension.internal.ActionProjectFile
All Implemented Interfaces:
ProjectFile

public class ActionProjectFile
extends Object
implements ProjectFile

Project file based on an I/O action

Author:
Simon Templer

Constructor Summary
ActionProjectFile(String loadActionId, String loadProviderId, Map<String,String> loadParameters, String saveActionId, String saveProviderId, Map<String,String> saveParameters)
          Create a project file based on an I/O action
 
Method Summary
 void apply()
          Apply the (loaded) configuration.
protected  IOAdvisor<?> getLoadAdvisor(String loadActionId)
          Get the advisor for loading the file.
 void load(InputStream in)
          Load the file from an input stream when loading a project.
 void reset()
          Reset the file when a project is loaded but no data for the file was present or loading the file failed.
 void store(OutputStream out)
          Store the file to an output stream when saving a project.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionProjectFile

public ActionProjectFile(String loadActionId,
                         String loadProviderId,
                         Map<String,String> loadParameters,
                         String saveActionId,
                         String saveProviderId,
                         Map<String,String> saveParameters)
Create a project file based on an I/O action

Parameters:
loadActionId - the action identifier for loading the file
loadProviderId - the provider identifier to use for loading the file, may be null to use auto-detection
loadParameters - the parameters for the I/O provider used for loading the file
saveActionId - the action identifier for saving the file
saveProviderId - the provider identifier to use for saving the file
saveParameters - the parameters for the I/O provider used for saving the file
Method Detail

load

public void load(InputStream in)
          throws Exception
Description copied from interface: ProjectFile
Load the file from an input stream when loading a project.

Specified by:
load in interface ProjectFile
Parameters:
in - the input stream
Throws:
Exception - if an error occurs loading the file
See Also:
ProjectFile.load(InputStream)

apply

public void apply()
Description copied from interface: ProjectFile
Apply the (loaded) configuration. Is called even if ProjectFile.load(InputStream) or ProjectFile.apply() haven't been called after the main project file has been loaded.

Specified by:
apply in interface ProjectFile
See Also:
ProjectFile.apply()

getLoadAdvisor

protected IOAdvisor<?> getLoadAdvisor(String loadActionId)
Get the advisor for loading the file. The default implementation uses the IOAdvisorExtension to look for a matching advisor.

Parameters:
loadActionId - the action ID for loading the project file
Returns:
the advisor

reset

public void reset()
Description copied from interface: ProjectFile
Reset the file when a project is loaded but no data for the file was present or loading the file failed.

Specified by:
reset in interface ProjectFile
See Also:
ProjectFile.reset()

store

public void store(OutputStream out)
           throws Exception
Description copied from interface: ProjectFile
Store the file to an output stream when saving a project.

Specified by:
store in interface ProjectFile
Parameters:
out - the output stream
Throws:
Exception - if an error occurs saving the file
See Also:
ProjectFile.store(OutputStream)

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d