Overview
This is the abstract method for the Translate Framework of the VIVO Harvester. This contains the main requirements of each VIVO Harvester, inStream and outStream, and stubs for the main methods that the other translators should overwrite.
Extended by:
States
Main Default Flow for most Translators
Properties
Name |
Type |
Visibility |
Description |
inStream |
InputStream |
protected |
the stream where data will be feed to the translator |
outStream |
OutputStream |
protected |
the stream where data will be sent back to the caller |
Execution
Most Translators have two modes of execution, straight file translation and using record handlers. Parameters for execution follow the format InFile/InRecordHandler, translationFile, OutFile/OutRecordHandler. Current supported switches are -xsl for XSLTranslator, -gloze for GlozeTranslator, and -rdf for RDFTranslator. Each of those classes require you to add to the - extension the sub type of execution (file or record handler)
Ex.
java translator -xslf 1234567.xml PubMedToXML.xsl
java translator -xslrh pubmedRH.xml PubMedToXML.xsl pubmedRDFRH.xml
Methods
setInStream
inputs |
OutputStream |
outputs |
None |
flow |
set global variable inStream equal to the InputStream |
Allows you to reset the inputstream in case you are using this method for several different inputs |
setOutStream
inputs |
InputStream |
outputs |
None |
flow |
set global variable outStream equal to the OutputStream |
Allows you to reset the outputstream in case you are using this method for several different outputs |
execute
inputs |
None |
outputs |
None |
flow |
check for properties |
true:
log start
log end
false:
throw IllegalArgumentException |
The execute method actually doesn't do anything more than check for the required inputs and let the user know that the Translator class is an abstract class. |
main
\ style="border-spacing:0;"
style="border:none;padding-top:0.0201in;padding-bottom:0.0201in;padding-left:0in;padding-right:0in;" |
Arguments |
style="border:none;padding-top:0.0201in;padding-bottom:0.0201in;padding-left:0in;padding-right:0in;" |
switch statement |
additoinal arguments are variable based on sub class
- |
|
style="border:none;padding-top:0.0201in;padding-bottom:0.0201in;padding-left:0in;padding-right:0in;" |
Returned |
style="border:none;padding-top:0.0201in;padding-bottom:0.0201in;padding-left:0in;padding-right:0in;" |
Variable based on sub class |
- |
|
style="border:none;padding-top:0.0201in;padding-bottom:0.0201in;padding-left:0in;padding-right:0in;" |
flow |
style="border:none;padding-top:0.0201in;padding-bottom:0.0201in;padding-left:0in;padding-right:0in;" |
- check for switch
- starts with -xsl
- remove the xsl
- create xsl translator
- pass args to xsl translator for execution
- starts with -gloze
- starts with -rdf
- starts with -xsl
- |
|
colspan="2" style="border:none;padding-top:0.0201in;padding-bottom:0.0201in;padding-left:0in;padding-right:0in;" |
The main method, allows for a switch to the appropriate library of execution. |