public interface PepperModule
Modifier and Type | Field and Description |
---|---|
static String |
ENDING_ALL_FILES
All kinds of file endings
|
static String |
ENDING_FOLDER
A string specifying a value for a folder as ending.
|
static String |
ENDING_LEAF_FOLDER
A string specifying a value for a leaf folder as ending.
|
static String |
ENDING_TAB
Ending for an tab file.
|
static String |
ENDING_TXT
Ending for an txt file.
|
static String |
ENDING_XML
Ending for an xml file.
|
Modifier and Type | Method and Description |
---|---|
PepperMapper |
createPepperMapper(org.corpus_tools.salt.graph.Identifier sElementId)
OVERRIDE THIS METHOD FOR CUSTOMIZED MAPPING.
|
void |
done(org.corpus_tools.salt.graph.Identifier identifier,
DOCUMENT_STATUS result)
This method is called by a
PepperMapperController object to
notify the PepperModule object, that the mapping for this object
is done. |
void |
done(PepperMapperController controller)
This method is called by a
PepperMapperController object to
notify the PepperModule object, that the mapping is done. |
void |
end()
This method is called by the pepper framework at the end of a conversion
process.
|
org.osgi.service.component.ComponentContext |
getComponentContext()
Returns the
ComponentContext of the OSGi environment the bundle
was started in. |
org.corpus_tools.salt.common.SCorpusGraph |
getCorpusGraph()
Returns the
SCorpusGraph object which is filled, manipulated or
exported by the current module. |
String |
getDesc()
Returns a short description of this module.
|
PepperModuleDesc |
getFingerprint()
Returns a
PepperModuleDesc object, which is a kind of a
fingerprint of this PepperModule . |
ModuleController |
getModuleController()
Returns the container and controller object for the current module.
|
MODULE_TYPE |
getModuleType()
Returns the type of this module.
|
String |
getName()
Returns the name of this module.
|
Double |
getProgress()
This method is invoked by the Pepper framework, to get the current total
progress of all
SDocument objects being processed by this module. |
Double |
getProgress(String globalId)
This method is invoked by the Pepper framework, to get the current
progress concerning the
SDocument object corresponding to the
given Identifier in percent. |
PepperModuleProperties |
getProperties()
Returns a
PepperModuleProperties object containing properties to
customize the behavior of this PepperModule . |
org.eclipse.emf.common.util.URI |
getResources()
Returns the path of the folder which might contain resources for a Pepper
module.
|
org.corpus_tools.salt.common.SaltProject |
getSaltProject()
Returns the
SaltProject object, which is filled, manipulated or
exported by the current module. |
SelfTestDesc |
getSelfTestDesc()
This method is called by the Pepper framework to run an integration test
for module.
|
Collection<String> |
getStartProblems()
If
isReadyToStart() has returned false, this method returns a
list of reasons why this module is not ready to start. |
org.eclipse.emf.common.util.URI |
getSupplierContact()
Returns a uri where to find more information about this module and where
to find some contact information to contact the supplier.
|
org.eclipse.emf.common.util.URI |
getSupplierHomepage()
Sets the
URI to the homepage describing the functionality of the
module. |
String |
getSymbolicName()
Returns the symbolic name of this OSGi bundle.
|
org.eclipse.emf.common.util.URI |
getTemproraries()
Deprecated.
|
String |
getVersion()
Returns the version of this module.
|
boolean |
isMultithreaded()
Returns whether this
PepperModule is able to run multithreaded. |
boolean |
isReadyToStart()
This method is called by the pepper framework after initializing this
object and directly before start processing.
|
List<org.corpus_tools.salt.graph.Identifier> |
proposeImportOrder(org.corpus_tools.salt.common.SCorpusGraph sCorpusGraph)
This method could be overridden, to make a proposal for the import order
of
SDocument objects. |
void |
setCorpusGraph(org.corpus_tools.salt.common.SCorpusGraph value)
Sets the
SCorpusGraph object which is filled, manipulated or
exported by the current module. |
void |
setDesc(String desc)
Sets a short description of this module.
|
void |
setIsMultithreaded(boolean isMultithreaded)
Sets whether this
PepperModule is able to run multithreaded. |
void |
setPepperModuleController_basic(ModuleController value)
Sets the container and controller object for the current module.
|
void |
setPepperModuleController(ModuleController value)
Sets the container and controller object for the current module.
|
void |
setProperties(PepperModuleProperties properties)
Sets the
PepperModuleProperties object containing properties to
customize the behavior of this PepperModule . |
void |
setResources(org.eclipse.emf.common.util.URI value)
Sets the resource folder used by
getResources() . |
void |
setSaltProject(org.corpus_tools.salt.common.SaltProject value)
Sets the
SaltProject object, which is filled, manipulated or
exported by the current module. |
void |
setSupplierContact(org.eclipse.emf.common.util.URI eMail)
Sets a uri where to find more information about this module and where to
find some contact information to contact the supplier.
|
void |
setSupplierHomepage(org.eclipse.emf.common.util.URI hp)
Returns the
URI to the homepage describing the functionality of
the module. |
void |
setSymbolicName(String value)
Sets the symbolic name of this OSGi bundle.
|
void |
setTemproraries(org.eclipse.emf.common.util.URI value)
Deprecated.
|
void |
setVersion(String value)
Sets the version of this module.
|
void |
start()
Starts the conversion process.
|
void |
start(org.corpus_tools.salt.graph.Identifier sElementId)
This method is called by the method
start() . |
static final String ENDING_FOLDER
#setTypeOfResource(URI)
, to determine, that even a folder can be
mapped to a resource.Can be used by importers to be put in collection
#getDocumentEndings()
or #getCorpusEndings()
static final String ENDING_LEAF_FOLDER
#setTypeOfResource(URI)
, to determine, that even a leaf
folder can be mapped to a resource. Can be used by importers to be put in
collection #getDocumentEndings()
or #getCorpusEndings()
static final String ENDING_XML
#getDocumentEndings()
or #getCorpusEndings()
static final String ENDING_TXT
#getDocumentEndings()
or #getCorpusEndings()
static final String ENDING_TAB
#getDocumentEndings()
or #getCorpusEndings()
static final String ENDING_ALL_FILES
PepperModuleDesc getFingerprint()
PepperModuleDesc
object, which is a kind of a
fingerprint of this PepperModule
. This fingerprint for instance
contains information like the name, the version of this module or
information about the supplier.MODULE_TYPE getModuleType()
org.osgi.service.component.ComponentContext getComponentContext()
ComponentContext
of the OSGi environment the bundle
was started in.String getName()
String getVersion()
void setVersion(String value)
value
- the new value of the 'Version' attribute.String getDesc()
void setDesc(String desc)
desc
- a short description of the task of this moduleorg.eclipse.emf.common.util.URI getSupplierContact()
void setSupplierContact(org.eclipse.emf.common.util.URI eMail)
uri
- contact address like eMail address or homepage addressorg.eclipse.emf.common.util.URI getSupplierHomepage()
URI
to the homepage describing the functionality of the
module.URI
to the homepagevoid setSupplierHomepage(org.eclipse.emf.common.util.URI hp)
URI
to the homepage describing the functionality of
the module.hp
- URI
to the homepagePepperModuleProperties getProperties()
PepperModuleProperties
object containing properties to
customize the behavior of this PepperModule
.void setProperties(PepperModuleProperties properties)
PepperModuleProperties
object containing properties to
customize the behavior of this PepperModule
. Please make sure,
that this method is called in constructor of your module. If not, a
general PepperModuleProperties
object is created by the pepper
framework and will be initialized. This means, when calling this method
later, all properties for customizing the module will be overridden.properties
- ModuleController getModuleController()
ModuleController
object is a kind of communicator between a
PepperModule
and the pepper framework.void setPepperModuleController(ModuleController value)
ModuleController
object is a kind of communicator between a
PepperModule
and the pepper framework. Also calls the inverse
method ModuleController.setPepperModule_basic(PepperModule)
.
Note, this method only should be called by pepper framework.value
- the new value of the 'Pepper Module Controller'
container reference.void setPepperModuleController_basic(ModuleController value)
ModuleController
object is a kind of communicator between a
PepperModule
and the pepper framework. Note, this method only
should be called by pepper framework.value
- the new value of the 'Pepper Module Controller'
container reference.org.corpus_tools.salt.common.SaltProject getSaltProject()
SaltProject
object, which is filled, manipulated or
exported by the current module.void setSaltProject(org.corpus_tools.salt.common.SaltProject value)
SaltProject
object, which is filled, manipulated or
exported by the current module. Note: This method only should be called
by the pepper framework.value
- the new value of the 'Salt Project' attribute.org.corpus_tools.salt.common.SCorpusGraph getCorpusGraph()
SCorpusGraph
object which is filled, manipulated or
exported by the current module. The SCorpusGraph
object is
contained in the salt project getSaltProject()
.void setCorpusGraph(org.corpus_tools.salt.common.SCorpusGraph value)
SCorpusGraph
object which is filled, manipulated or
exported by the current module. The SCorpusGraph
object is
contained in the salt project getSaltProject()
. Note: This
method only should be called by the pepper framework.value
- the new value of the 'SCorpus Graph' attribute.org.eclipse.emf.common.util.URI getResources()
void setResources(org.eclipse.emf.common.util.URI value)
getResources()
. This method
should only be invoked by the Pepper framework. The documentation of
getResources()
for more details.value
- path to resource folder@Deprecated org.eclipse.emf.common.util.URI getTemproraries()
@Deprecated void setTemproraries(org.eclipse.emf.common.util.URI value)
String getSymbolicName()
void setSymbolicName(String value)
PepperModuleImpl
class. If you want to manipulate that method.
make sure to set the symbolic name and make sure, that it is set to the
bundles symbolic name.value
- the new value of the 'Symbolic Name' attribute.Collection<String> getStartProblems()
isReadyToStart()
has returned false, this method returns a
list of reasons why this module is not ready to start.boolean isReadyToStart() throws PepperModuleNotReadyException
PepperModuleProperties
, setting temporary files,
resources etc. . returns false or throws an exception in case of
PepperModule
instance is not ready for any reason MODULE_TYPE
is not nullgetStartProblems()
.PepperModule
instance is not ready for any reason,
true, else.PepperModuleNotReadyException
void setIsMultithreaded(boolean isMultithreaded)
PepperModule
is able to run multithreaded. This
method only should be called by the module itself.isThreaded
- true, if module can run in multithread mode.boolean isMultithreaded()
PepperModule
is able to run multithreaded.
The behavior only should be set by the module itself via calling
setIsMultithreaded(boolean)
.void start() throws PepperModuleException
start(Identifier)
for each SDocument
and SCorpus
object being contained in the set SCorpusGraph
. This is done in a
multithreaded way by default. Note: When your module should not
run in multithreaded mode, call setIsMultithreaded(boolean)
.PepperModuleException
void start(org.corpus_tools.salt.graph.Identifier sElementId) throws PepperModuleException
start()
. This is the only
call in Pepper. You do not need to override this method, in case of you
are happy with the default behavior. In default, this method invokes a
multithreaded process, which creates PepperMapper
objects for
each given Identifier
object, to process the corresponding
SDocument
or SCorpus
object. The PepperMapper
objects are not created by the method itself, the creation is delegated
to createPepperMapper(Identifier)
, which has to be overridden.
Default initializations are done there (for more details, please take a
look into the doc of that method). Further this method links the created
PepperMapper
object to a PepperMapperController
object
and makes sure, that the process runs in a by Pepper controlled manner.
setIsMultithreaded(boolean)
. #getProgress(Identifier)
PepperModuleException
PepperMapper createPepperMapper(org.corpus_tools.salt.graph.Identifier sElementId)
PepperMapper
object and returns
it. You can here do some additional initialisations. Thinks like setting
the Identifier
of the SDocument
or SCorpus
object
and the URI
resource is done by the framework (or more in detail
in method start()
). The parameter sElementId
, if a
PepperMapper
object should be created in case of the object to
map is either an SDocument
object or an SCorpus
object of
the mapper should be initialized differently. sElementId
- Identifier
of the SCorpus
or SDocument
to be processed.PepperMapper
object to do the mapping task for object
connected to given Identifier
List<org.corpus_tools.salt.graph.Identifier> proposeImportOrder(org.corpus_tools.salt.common.SCorpusGraph sCorpusGraph)
SDocument
objects. Overriding this method is useful, in case
of the order matters in the specific mapping of this PepperModule
. In this case a influencing the import order can decrease the processing
time. If you do not want to influence the order, just return an empty
list, or don't override this method. SCorpusGraph
. sCorpusGraph
- the SCorpusGraph
object for which the order could be
proposedSDocument
objectsDouble getProgress(String globalId)
SDocument
object corresponding to the
given Identifier
in percent. A valid value return must be between
0 and 1. start(Identifier)
or start()
, please also override this
method, because it accesses an internal list of all mappers, which
initialized in start(Identifier)
.globalID
- identifier of the requested SDocument
object, note,
that this is not the Identifier
.Double getProgress()
SDocument
objects being processed by this module.
A valid value return must be between 0 and 1. This method can be
overridden by a derived PepperModule
class. If this method is not
overridden, it will return null.void end() throws PepperModuleException
SDocument
and SCorpus
objects) have been processed. This method can be used to do some clean up
(e.g. to close streams etc.).PepperModuleException
void done(PepperMapperController controller)
PepperMapperController
object to
notify the PepperModule
object, that the mapping is done.controller
- The object which is done with its jobvoid done(org.corpus_tools.salt.graph.Identifier identifier, DOCUMENT_STATUS result)
PepperMapperController
object to
notify the PepperModule
object, that the mapping for this object
is done.identifier
- result
- SelfTestDesc getSelfTestDesc()
SelfTestDesc
object needs to
provide an input corpus path and an output corpus path.
When this module is:
SelfTestDesc.getInputCorpusPath()
should contain
the format to be imported. SelfTestDesc.getExpectedCorpusPath()
should contain the expected salt project (for control).SelfTestDesc.getInputCorpusPath()
should
contain a salt project which is the module's input.
SelfTestDesc.getExpectedCorpusPath()
should contain the expected
salt project (for control).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 method
SelfTestDesc.compare(SaltProject, SaltProject)
is called to
compare output salt project with expected salt project. When the module
is an exporter the method SelfTestDesc.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.Copyright © 2009–2019 Humboldt-Universität zu Berlin, INRIA. All rights reserved.