Package org.corpus_tools.pepper.impl
Class PepperMapperImpl
- java.lang.Object
-
- org.corpus_tools.pepper.impl.PepperMapperImpl
-
- All Implemented Interfaces:
PepperMapper
- Direct Known Subclasses:
SaltValidator.ValidatorMapper,TextImporter.TextMapper
public class PepperMapperImpl extends Object implements PepperMapper
An abstract implementation ofPepperMapperto be used for further derivations for specific mapping purposes.- Author:
- Florian Zipser
-
-
Field Summary
Fields Modifier and Type Field Description protected PepperMapperControllercontrollerprotected DoubleprogressStores the current progress (between 0 and 1)protected PepperModulePropertiespropsPepperModulePropertiesobject containing user customizations to be observed during the mapping.
-
Constructor Summary
Constructors Constructor Description PepperMapperImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProgress(Double progress){@inheritDoc PepperMapper#addProgress(Double)}org.corpus_tools.salt.common.SCorpusgetCorpus(){@inheritDoc PepperMapper#getCorpus()}org.corpus_tools.salt.common.SDocumentgetDocument(){@inheritDoc PepperMapper#getDocument()}DOCUMENT_STATUSgetMappingResult(){@inheritDoc PepperMapperConnector#getMappingResult()}List<MappingSubject>getMappingSubjects()Returns a list of all subjects (SDocumentorSCorpus) to be mergedPepperMapperControllergetPepperMapperController()Returns the controller of this mapper, to grant n access to Pepper via the controller.DoublegetProgress(){@inheritDoc PepperMapper#getProgress()}PepperModulePropertiesgetProperties(){@inheritDoc PepperMapper#getProperties()}org.eclipse.emf.common.util.URIgetResourceURI(){@inheritDoc PepperMapper#getResourceURI()}protected voidinitialize()This method initializes this object and is called by the constructor.DOCUMENT_STATUSmapSCorpus(){@inheritDoc PepperMapper#mapSCorpus()} OVERRIDE THIS METHOD FOR CUSTOMIZED MAPPING.DOCUMENT_STATUSmapSDocument(){@inheritDoc PepperMapper#mapSDocument()} OVERRIDE THIS METHOD FOR CUSTOMIZED MAPPING.protected voidreadXMLResource(DefaultHandler2 contentHandler, org.eclipse.emf.common.util.URI documentLocation)Helper method to read an xml file with aDefaultHandler2implementation given as contentHandler.voidsetCorpus(org.corpus_tools.salt.common.SCorpus sCorpus){@inheritDoc PepperMapper#setCorpus(SCorpus)}voidsetDocument(org.corpus_tools.salt.common.SDocument sDocument){@inheritDoc PepperMapper#setDocument(SDocument)}voidsetMappingResult(DOCUMENT_STATUS mappingResult){@inheritDoc PepperMapperConnector#setMappingResult(DOCUMENT_STATUS)}voidsetPepperMapperController(PepperMapperController controller)Sets the controller of this mapper, to grant n access to Pepper via the controller.voidsetProgress(Double progress){@inheritDoc PepperMapper#setProgress(Double)} OVERRIDE THIS METHOD FOR CUSTOMIZED MAPPING.voidsetProperties(PepperModuleProperties props){@inheritDoc PepperMapper#setProperties(PepperModuleProperties)}voidsetResourceURI(org.eclipse.emf.common.util.URI resourceURI){@inheritDoc PepperMapper#setResourceURI(URI)}
-
-
-
Field Detail
-
props
protected PepperModuleProperties props
PepperModulePropertiesobject containing user customizations to be observed during the mapping.
-
progress
protected volatile Double progress
Stores the current progress (between 0 and 1)
-
controller
protected PepperMapperController controller
-
-
Method Detail
-
getMappingSubjects
public List<MappingSubject> getMappingSubjects()
Returns a list of all subjects (SDocumentorSCorpus) to be merged- Specified by:
getMappingSubjectsin interfacePepperMapper- Returns:
- a list of
MappingSubject
-
getResourceURI
public org.eclipse.emf.common.util.URI getResourceURI()
{@inheritDoc PepperMapper#getResourceURI()}- Specified by:
getResourceURIin interfacePepperMapper- Returns:
- uri of resource
-
setResourceURI
public void setResourceURI(org.eclipse.emf.common.util.URI resourceURI)
{@inheritDoc PepperMapper#setResourceURI(URI)}- Specified by:
setResourceURIin interfacePepperMapper- Parameters:
resourceURI- uri of resource
-
getDocument
public org.corpus_tools.salt.common.SDocument getDocument()
{@inheritDoc PepperMapper#getDocument()}- Specified by:
getDocumentin interfacePepperMapper- Returns:
SDocumentobject to be mapped
-
setDocument
public void setDocument(org.corpus_tools.salt.common.SDocument sDocument)
{@inheritDoc PepperMapper#setDocument(SDocument)}- Specified by:
setDocumentin interfacePepperMapper- Parameters:
sDocument-SDocumentobject to be mapped
-
getCorpus
public org.corpus_tools.salt.common.SCorpus getCorpus()
{@inheritDoc PepperMapper#getCorpus()}- Specified by:
getCorpusin interfacePepperMapper- Returns:
SCorpusobject to be mapped
-
setCorpus
public void setCorpus(org.corpus_tools.salt.common.SCorpus sCorpus)
{@inheritDoc PepperMapper#setCorpus(SCorpus)}- Specified by:
setCorpusin interfacePepperMapper- Parameters:
sCorpus-SCorpusobject to be mapped
-
getProperties
public PepperModuleProperties getProperties()
{@inheritDoc PepperMapper#getProperties()}- Specified by:
getPropertiesin interfacePepperMapper- Returns:
PepperModulePropertiesobject to be used
-
setProperties
public void setProperties(PepperModuleProperties props)
{@inheritDoc PepperMapper#setProperties(PepperModuleProperties)}- Specified by:
setPropertiesin interfacePepperMapper- Parameters:
props-PepperModulePropertiesobject to be used
-
setMappingResult
public void setMappingResult(DOCUMENT_STATUS mappingResult)
{@inheritDoc PepperMapperConnector#setMappingResult(DOCUMENT_STATUS)}- Specified by:
setMappingResultin interfacePepperMapper
-
getMappingResult
public DOCUMENT_STATUS getMappingResult()
{@inheritDoc PepperMapperConnector#getMappingResult()}- Specified by:
getMappingResultin interfacePepperMapper- Returns:
- mapping result
-
initialize
protected void initialize()
This method initializes this object and is called by the constructor. OVERRIDE THIS METHOD FOR CUSTOMIZED MAPPING.
-
mapSDocument
public DOCUMENT_STATUS mapSDocument()
{@inheritDoc PepperMapper#mapSDocument()} OVERRIDE THIS METHOD FOR CUSTOMIZED MAPPING.NOTE: This method is only called if the element to be mapped is of type SDocument, i.e., if this.getDocument() != null!- Specified by:
mapSDocumentin interfacePepperMapper
-
mapSCorpus
public DOCUMENT_STATUS mapSCorpus()
{@inheritDoc PepperMapper#mapSCorpus()} OVERRIDE THIS METHOD FOR CUSTOMIZED MAPPING.NOTE: This method is only called if the element to be mapped is of type SCorpus, i.e., if this.getCorpus() != null!- Specified by:
mapSCorpusin interfacePepperMapper
-
getProgress
public Double getProgress()
{@inheritDoc PepperMapper#getProgress()}- Specified by:
getProgressin interfacePepperMapper
-
addProgress
public void addProgress(Double progress)
{@inheritDoc PepperMapper#addProgress(Double)}- Specified by:
addProgressin interfacePepperMapper- Parameters:
progress- the progress must be a value between 0 for 0% and 1 for 100%
-
setProgress
public void setProgress(Double progress)
{@inheritDoc PepperMapper#setProgress(Double)} OVERRIDE THIS METHOD FOR CUSTOMIZED MAPPING.- Specified by:
setProgressin interfacePepperMapper- Parameters:
progress- the progress must be a value between 0 for 0% and 1 for 100%
-
readXMLResource
protected void readXMLResource(DefaultHandler2 contentHandler, org.eclipse.emf.common.util.URI documentLocation)
Helper method to read an xml file with aDefaultHandler2implementation given as contentHandler. It is assumed, that the file encoding is set to UTF-8.- Parameters:
contentHandler-DefaultHandler2implementationdocumentLocation- location of the xml-file
-
setPepperMapperController
public void setPepperMapperController(PepperMapperController controller)
Sets the controller of this mapper, to grant n access to Pepper via the controller.- Specified by:
setPepperMapperControllerin interfacePepperMapper- Parameters:
controller- controller for this object
-
getPepperMapperController
public PepperMapperController getPepperMapperController()
Returns the controller of this mapper, to grant n access to Pepper via the controller.- Specified by:
getPepperMapperControllerin interfacePepperMapper- Returns:
- controller for this object
-
-