Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.common.core.io.impl
Class AbstractIOProvider

java.lang.Object
  extended by eu.esdihumboldt.hale.common.core.io.impl.AbstractIOProvider
All Implemented Interfaces:
IOProvider
Direct Known Subclasses:
AbstractExportProvider, AbstractImportProvider

public abstract class AbstractIOProvider
extends Object
implements IOProvider

Abstract base class for implementing IOProviders

Since:
2.2
Author:
Simon Templer
Partner:
01 / Fraunhofer Institute for Computer Graphics Research

Field Summary
 
Fields inherited from interface eu.esdihumboldt.hale.common.core.io.IOProvider
PARAM_CONTENT_TYPE
 
Constructor Summary
protected AbstractIOProvider()
          Default constructor
 
Method Summary
protected  void addSupportedParameter(String name)
          Add a supported parameter name, should be called in the constructor
 IOReport execute(ProgressIndicator progress)
          Execute the I/O provider.
protected abstract  IOReport execute(ProgressIndicator progress, IOReporter reporter)
          Execute the I/O provider.
protected  void fail(String message)
          Fail validation or execution if the configuration is not valid
 org.eclipse.core.runtime.content.IContentType getContentType()
          Get the content type
protected abstract  String getDefaultTypeName()
          Get the default type name if no content type is provided
 String getParameter(String name)
          Get the value for the given parameter name
 Set<String> getSupportedParameters()
          Get the supported configuration parameters.
protected  String getTypeName()
          Get the content type name.
 void loadConfiguration(Map<String,String> configuration)
          Uses setParameter(String, String) to load the configuration.
 void setContentType(org.eclipse.core.runtime.content.IContentType contentType)
          Set the content type.
 void setParameter(String name, String value)
          Set a parameter
 void storeConfiguration(Map<String,String> configuration)
          Stores all parameters that were set using setParameter(String, String) in the configuration.
 void validate()
          Validate the I/O provider configuration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.esdihumboldt.hale.common.core.io.IOProvider
createReporter, isCancelable
 

Constructor Detail

AbstractIOProvider

protected AbstractIOProvider()
Default constructor

Method Detail

execute

public IOReport execute(ProgressIndicator progress)
                 throws IOProviderConfigurationException,
                        IOException
Description copied from interface: IOProvider
Execute the I/O provider.

Specified by:
execute in interface IOProvider
Parameters:
progress - the progress indicator, may be null
Returns:
the execution report
Throws:
IOProviderConfigurationException - if the I/O provider was not configured properly
IOException - if an I/O operation fails
See Also:
IOProvider.execute(ProgressIndicator)

execute

protected abstract IOReport execute(ProgressIndicator progress,
                                    IOReporter reporter)
                             throws IOProviderConfigurationException,
                                    IOException
Execute the I/O provider.

Parameters:
progress - the progress indicator
reporter - the reporter to use for the execution report
Returns:
the execution report
Throws:
IOProviderConfigurationException - if the I/O provider was not configured properly
IOException - if an I/O operation fails

getTypeName

protected String getTypeName()
Get the content type name.

Returns:
the content type name

getDefaultTypeName

protected abstract String getDefaultTypeName()
Get the default type name if no content type is provided

Returns:
the default content type

validate

public void validate()
              throws IOProviderConfigurationException
Description copied from interface: IOProvider
Validate the I/O provider configuration

Specified by:
validate in interface IOProvider
Throws:
IOProviderConfigurationException - if the I/O provider was not configured properly
See Also:
IOProvider.validate()

loadConfiguration

public final void loadConfiguration(Map<String,String> configuration)
Uses setParameter(String, String) to load the configuration. For changing the behavior please override setParameter(String, String)

Specified by:
loadConfiguration in interface IOProvider
Parameters:
configuration - the configuration to load
See Also:
IOProvider.loadConfiguration(Map)

storeConfiguration

public void storeConfiguration(Map<String,String> configuration)
Stores all parameters that were set using setParameter(String, String) in the configuration. For changing the behavior please override this method.

Specified by:
storeConfiguration in interface IOProvider
Parameters:
configuration - the configuration to populate
See Also:
IOProvider.storeConfiguration(Map)

fail

protected void fail(String message)
             throws IOProviderConfigurationException
Fail validation or execution if the configuration is not valid

Parameters:
message - the error message
Throws:
IOProviderConfigurationException - always

addSupportedParameter

protected void addSupportedParameter(String name)
Add a supported parameter name, should be called in the constructor

Parameters:
name - the supported parameter name to add

getParameter

public String getParameter(String name)
Description copied from interface: IOProvider
Get the value for the given parameter name

Specified by:
getParameter in interface IOProvider
Parameters:
name - the parameter name
Returns:
the parameter value or null
See Also:
IOProvider.getParameter(String)

getSupportedParameters

public Set<String> getSupportedParameters()
Description copied from interface: IOProvider
Get the supported configuration parameters.

Specified by:
getSupportedParameters in interface IOProvider
Returns:
the supported parameters
See Also:
IOProvider.getSupportedParameters()

setParameter

public void setParameter(String name,
                         String value)
Description copied from interface: IOProvider
Set a parameter

Specified by:
setParameter in interface IOProvider
Parameters:
name - the parameter name
value - the parameter value
See Also:
IOProvider.setParameter(String, String)

getContentType

public org.eclipse.core.runtime.content.IContentType getContentType()
Description copied from interface: IOProvider
Get the content type

Specified by:
getContentType in interface IOProvider
Returns:
the content type, may be null
See Also:
IOProvider.getContentType()

setContentType

public void setContentType(org.eclipse.core.runtime.content.IContentType contentType)
Description copied from interface: IOProvider
Set the content type. This may be optional if the I/O provider doesn't differentiate between content types.

Specified by:
setContentType in interface IOProvider
Parameters:
contentType - the content type
See Also:
IOProvider.setContentType(IContentType)

Humboldt Alignment Editor 2.5.0

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