Humboldt Alignment Editor 2.5.0

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

java.lang.Object
  extended by eu.esdihumboldt.hale.common.core.io.impl.AbstractIOProvider
      extended by eu.esdihumboldt.hale.common.core.io.impl.AbstractImportProvider
All Implemented Interfaces:
ImportProvider, IOProvider
Direct Known Subclasses:
AbstractAlignmentReader, AbstractProjectReader, AbstractSchemaReader, GZipEnabledImport, ProjectParser, SLDStyleReader, XmlCodeListReader

public abstract class AbstractImportProvider
extends AbstractIOProvider
implements ImportProvider

Abstract ImportProvider implementation

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.ImportProvider
PARAM_RESOURCE_ID, PARAM_SOURCE
 
Fields inherited from interface eu.esdihumboldt.hale.common.core.io.IOProvider
PARAM_CONTENT_TYPE
 
Constructor Summary
AbstractImportProvider()
          Default constructor
 
Method Summary
 IOReporter createReporter()
          Create a reporter configured for the execution of this I/O provider.
 IOReport execute(ProgressIndicator progress)
          Execute the I/O provider.
protected  String generateResourceId()
          Generate the unique resource identifier.
 String getResourceIdentifier()
          Get the resource identifier.
 LocatableInputSupplier<? extends InputStream> getSource()
          Get the import source
 void setParameter(String name, String value)
          Set a parameter
 void setSource(LocatableInputSupplier<? extends InputStream> source)
          Set the import source
 void storeConfiguration(Map<String,String> configuration)
          Stores all parameters that were set using AbstractIOProvider.setParameter(String, String) in the configuration.
 void validate()
          Validate the I/O provider configuration
 
Methods inherited from class eu.esdihumboldt.hale.common.core.io.impl.AbstractIOProvider
addSupportedParameter, execute, fail, getContentType, getDefaultTypeName, getParameter, getSupportedParameters, getTypeName, loadConfiguration, setContentType
 
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
getContentType, getParameter, getSupportedParameters, isCancelable, loadConfiguration, setContentType
 

Constructor Detail

AbstractImportProvider

public AbstractImportProvider()
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
Overrides:
execute in class AbstractIOProvider
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:
AbstractIOProvider.execute(ProgressIndicator)

generateResourceId

protected String generateResourceId()
Generate the unique resource identifier.

Returns:
the generated resource identifier

setSource

public void setSource(LocatableInputSupplier<? extends InputStream> source)
Description copied from interface: ImportProvider
Set the import source

Specified by:
setSource in interface ImportProvider
Parameters:
source - the source input supplier
See Also:
ImportProvider.setSource(LocatableInputSupplier)

getSource

public LocatableInputSupplier<? extends InputStream> getSource()
Description copied from interface: ImportProvider
Get the import source

Specified by:
getSource in interface ImportProvider
Returns:
the source input supplier
See Also:
ImportProvider.getSource()

validate

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

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

storeConfiguration

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

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

setParameter

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

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

createReporter

public IOReporter createReporter()
Description copied from interface: IOProvider
Create a reporter configured for the execution of this I/O provider. This method can also be used internally in the implementation of IOProvider.execute(ProgressIndicator).

Specified by:
createReporter in interface IOProvider
Returns:
the I/O reporter
See Also:
IOProvider.createReporter()

getResourceIdentifier

public String getResourceIdentifier()
Description copied from interface: ImportProvider
Get the resource identifier. The identifier serves to uniquely identify the resource represented by the import provider. It is either generated on execute or loaded from a stored configuration.

Specified by:
getResourceIdentifier in interface ImportProvider
Returns:
the resource identifier, may be null if the provider was not executed yet
See Also:
ImportProvider.getResourceIdentifier()

Humboldt Alignment Editor 2.5.0

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