Class SaltXMLExporter
- java.lang.Object
-
- org.corpus_tools.pepper.impl.PepperModuleImpl
-
- org.corpus_tools.pepper.impl.PepperExporterImpl
-
- org.corpus_tools.pepper.modules.coreModules.SaltXMLExporter
-
- All Implemented Interfaces:
Thread.UncaughtExceptionHandler,PepperExporter,PepperModule
public class SaltXMLExporter extends PepperExporterImpl implements PepperExporter
This is a PepperExporter which exports a salt model to the SaltXML format. This module stores every document in a separate file. These files then contains the document structure. The corpus structure is stored in a single file called saltProject + SALT_FILE_ENDING. The value SALT_FILE_ENDING can be got by method getSaltFileEnding().
When method start() is called, the saltProject will be attached to a resource with the uri "this.getCorpusDefinition().getCorpusPath().toFileString() +"/ "+ " saltProject"+ SALT_ENDING". Before it can be stored, all documents have to be processed.
The module now waits for documents which can be exported. When a document finished all previous modules, it can be exported. This means, that 1) every document will also get a resource with the uri "this.getCorpusDefinition().getCorpusPath().toFileString() + " / " sElementId.getSElementPath()+ SALT_FILE_ENDING". And 2) the document structure will be stored to file.
After all was done, the saltProject will be exported.- Version:
- 1.0
- Author:
- Florian Zipser
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.corpus_tools.pepper.modules.PepperExporter
PepperExporter.EXPORT_MODE
-
-
Field Summary
Fields Modifier and Type Field Description static StringFORMAT_NAMEstatic StringFORMAT_VERSIONstatic StringMODULE_NAME-
Fields inherited from class org.corpus_tools.pepper.impl.PepperExporterImpl
corpusDefinition
-
Fields inherited from class org.corpus_tools.pepper.impl.PepperModuleImpl
isMultithreaded, logger, moduleController, resources, saltProject, sCorpusGraph, symbolicName, temproraries
-
Fields inherited from interface org.corpus_tools.pepper.modules.PepperModule
ENDING_ALL_FILES, ENDING_FOLDER, ENDING_LEAF_FOLDER, ENDING_TAB, ENDING_TXT, ENDING_XML
-
-
Constructor Summary
Constructors Constructor Description SaltXMLExporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PepperMappercreatePepperMapper(org.corpus_tools.salt.graph.Identifier sElementId)Creates a mapper of typeSaltXMLExporter.SaltXMLExporterMapper.SelfTestDescgetSelfTestDesc()This method is called by the Pepper framework to run an integration test for module.voidstart()Creates aResourcefor theSaltProjectto persist contained objects likeSDocumentGraphetc.-
Methods inherited from class org.corpus_tools.pepper.impl.PepperExporterImpl
addSupportedFormat, createFolderStructure, exportCorpusStructure, getCorpusDesc, getDocumentEnding, getExportMode, getIdentifier2ResourceTable, getSupportedFormats, setCorpusDesc, setDocumentEnding, setExportMode
-
Methods inherited from class org.corpus_tools.pepper.impl.PepperModuleImpl
activate, done, done, end, getComponentContext, getCorpusGraph, getDesc, getDocumentId2DC, getFingerprint, getMapperControllers, getMapperThreadGroup, getModuleController, getModuleType, getName, getProgress, getProgress, getProperties, getResources, getSaltProject, getStartProblems, getSupplierContact, getSupplierHomepage, getSymbolicName, getTemproraries, getVersion, isMultithreaded, isReadyToStart, proposeImportOrder, setCorpusGraph, setDesc, setIsMultithreaded, setMapperThreadGroup, setName, setPepperModuleController, setPepperModuleController_basic, setProperties, setResources, setSaltProject, setSupplierContact, setSupplierHomepage, setSymbolicName, setTemproraries, setVersion, start, toString, uncaughtException
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.corpus_tools.pepper.modules.PepperExporter
addSupportedFormat, createFolderStructure, exportCorpusStructure, getCorpusDesc, getDocumentEnding, getExportMode, getIdentifier2ResourceTable, getSupportedFormats, setCorpusDesc, setDocumentEnding, setExportMode
-
Methods inherited from interface org.corpus_tools.pepper.modules.PepperModule
done, done, end, getComponentContext, getCorpusGraph, getDesc, getFingerprint, getModuleController, getModuleType, getName, getProgress, getProgress, getProperties, getResources, getSaltProject, getStartProblems, getSupplierContact, getSupplierHomepage, getSymbolicName, getTemproraries, getVersion, isMultithreaded, isReadyToStart, proposeImportOrder, setCorpusGraph, setDesc, setIsMultithreaded, setPepperModuleController, setPepperModuleController_basic, setProperties, setResources, setSaltProject, setSupplierContact, setSupplierHomepage, setSymbolicName, setTemproraries, setVersion, start
-
-
-
-
Field Detail
-
MODULE_NAME
public static final String MODULE_NAME
- See Also:
- Constant Field Values
-
FORMAT_NAME
public static final String FORMAT_NAME
- See Also:
- Constant Field Values
-
FORMAT_VERSION
public static final String FORMAT_VERSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSelfTestDesc
public SelfTestDesc getSelfTestDesc()
Description copied from interface:PepperModuleThis method is called by the Pepper framework to run an integration test for module. When the method returns null, it means that no integration test is supported. Otherwise, theSelfTestDescobject needs to provide an input corpus path and an output corpus path. When this module is:- an importer:
SelfTestDesc.getInputCorpusPath()should contain the format to be imported.SelfTestDesc.getExpectedCorpusPath()should contain the expected salt project (for control). - a manipulator:
SelfTestDesc.getInputCorpusPath()should contain a salt project which is the module's input.SelfTestDesc.getExpectedCorpusPath()should contain the expected salt project (for control). - an exporter:
SelfTestDesc.getInputCorpusPath()should contain a salt project which is the module's input.SelfTestDesc.getExpectedCorpusPath()should contain the expected corpus in output format.
return new IntegrationTestDesc(inputPath, outputPath);
When this module is an importer or a manipulator the methodSelfTestDesc.compare(SaltProject, SaltProject)is called to compare output salt project with expected salt project. When the module is an exporter the methodSelfTestDesc.compare(URI, URI)is called to compare the created output folder with an expected one. By default this method checks whether the file structure and each file is equal.- Specified by:
getSelfTestDescin interfacePepperModule- Overrides:
getSelfTestDescin classPepperModuleImpl- Returns:
- test description
- an importer:
-
createPepperMapper
public PepperMapper createPepperMapper(org.corpus_tools.salt.graph.Identifier sElementId)
Creates a mapper of typeSaltXMLExporter.SaltXMLExporterMapper. {@inheritDoc PepperModule#createPepperMapper(Identifier)}- Specified by:
createPepperMapperin interfacePepperModule- Overrides:
createPepperMapperin classPepperModuleImpl- Parameters:
sElementId-Identifierof theSCorpusorSDocumentto be processed.- Returns:
PepperMapperobject to do the mapping task for object connected to givenIdentifier
-
start
public void start() throws PepperModuleExceptionCreates aResourcefor theSaltProjectto persist contained objects likeSDocumentGraphetc. This is caused by an EMF constraint.- Specified by:
startin interfacePepperModule- Overrides:
startin classPepperExporterImpl- Throws:
PepperModuleException
-
-