Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.io.csv.reader.internal
Class CSVSchemaReader

java.lang.Object
  extended by eu.esdihumboldt.hale.common.core.io.impl.AbstractIOProvider
      extended by eu.esdihumboldt.hale.common.core.io.impl.AbstractImportProvider
          extended by eu.esdihumboldt.hale.common.schema.io.impl.AbstractSchemaReader
              extended by eu.esdihumboldt.hale.io.csv.reader.internal.CSVSchemaReader
All Implemented Interfaces:
ImportProvider, IOProvider, SchemaReader, CSVConstants

public class CSVSchemaReader
extends AbstractSchemaReader
implements CSVConstants

Reads a schema from a CSV file.

Author:
Thorsten Reitz, Simon Templer

Field Summary
static String[] firstLine
          The first line of the CSV file
static String PARAM_PROPERTY
          Name of the parameter specifying the property name
static String PARAM_PROPERTYTYPE
          Name of the parameter specifying the property type
 
Fields inherited from interface eu.esdihumboldt.hale.io.csv.reader.internal.CSVConstants
DEFAULT_ESCAPE, DEFAULT_QUOTE, DEFAULT_SEPARATOR, PARAM_ESCAPE, PARAM_GEOMETRY, PARAM_QUOTE, PARAM_SEPARATOR, PARAM_TYPENAME
 
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
CSVSchemaReader()
           
 
Method Summary
protected  IOReport execute(ProgressIndicator progress, IOReporter reporter)
          Execute the I/O provider.
protected  String getDefaultTypeName()
          Get the default type name if no content type is provided
 Schema getSchema()
          Get the loaded schema
 boolean isCancelable()
          States if the execution of the provider is cancelable
 void validate()
          Validate the I/O provider configuration
 
Methods inherited from class eu.esdihumboldt.hale.common.schema.io.impl.AbstractSchemaReader
getSharedTypes, setSharedTypes
 
Methods inherited from class eu.esdihumboldt.hale.common.core.io.impl.AbstractImportProvider
createReporter, execute, generateResourceId, getResourceIdentifier, getSource, setParameter, setSource, storeConfiguration
 
Methods inherited from class eu.esdihumboldt.hale.common.core.io.impl.AbstractIOProvider
addSupportedParameter, fail, getContentType, 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.ImportProvider
getResourceIdentifier, getSource, setSource
 
Methods inherited from interface eu.esdihumboldt.hale.common.core.io.IOProvider
createReporter, execute, getContentType, getParameter, getSupportedParameters, loadConfiguration, setContentType, setParameter, storeConfiguration
 

Field Detail

firstLine

public static String[] firstLine
The first line of the CSV file


PARAM_PROPERTY

public static final String PARAM_PROPERTY
Name of the parameter specifying the property name

See Also:
Constant Field Values

PARAM_PROPERTYTYPE

public static final String PARAM_PROPERTYTYPE
Name of the parameter specifying the property type

See Also:
Constant Field Values
Constructor Detail

CSVSchemaReader

public CSVSchemaReader()
Method Detail

isCancelable

public boolean isCancelable()
Description copied from interface: IOProvider
States if the execution of the provider is cancelable

Specified by:
isCancelable in interface IOProvider
Returns:
if the execution is cancelable
See Also:
IOProvider.isCancelable()

getSchema

public Schema getSchema()
Description copied from interface: SchemaReader
Get the loaded schema

Specified by:
getSchema in interface SchemaReader
Returns:
the schema
See Also:
SchemaReader.getSchema()

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 AbstractImportProvider
Throws:
IOProviderConfigurationException - if the I/O provider was not configured properly
See Also:
AbstractImportProvider.validate()

execute

protected IOReport execute(ProgressIndicator progress,
                           IOReporter reporter)
                    throws IOProviderConfigurationException,
                           IOException
Description copied from class: AbstractIOProvider
Execute the I/O provider.

Specified by:
execute in class AbstractIOProvider
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
See Also:
AbstractIOProvider.execute(ProgressIndicator, IOReporter)

getDefaultTypeName

protected String getDefaultTypeName()
Description copied from class: AbstractIOProvider
Get the default type name if no content type is provided

Specified by:
getDefaultTypeName in class AbstractIOProvider
Returns:
the default content type
See Also:
AbstractIOProvider.getDefaultTypeName()

Humboldt Alignment Editor 2.5.0

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