uk.ac.soton.harvester
Class OUTHarvester

java.lang.Object
  |
  +--uk.ac.soton.harvester.OUTHarvester

public class OUTHarvester
extends java.lang.Object
implements com.bids.jol.loaders.CitationsHarvester

The OUTHarvester class sets up the environment for the real citation processing. It opens the input and output files and then creates a deciter object to handle the real work.


Field Summary
(package private)  java.lang.String id
          id holds the identifier of the current article
(package private)  java.io.BufferedReader in
          in simply holds a reference to the input reader.
(package private)  java.io.File inFile
          inFile holds the file to which the input reader is to be connected.
(package private)  java.lang.String[] options
          options holds the set of hints that control the deciter process.
 
Constructor Summary
OUTHarvester()
           
 
Method Summary
 java.lang.String getArticleId()
          getArticleId accessor method for the id
 java.io.File getInputFile()
          getInputFile accessor method for inFile
 int harvest(java.io.BufferedWriter xmlOutput)
          Create the appropriate readers and writers, make a deciter object, set its hints/options and invoke its doit method to make it to do the dirty work.
 void setArticleId(java.lang.String aid)
          setArticleId sets the article id
 void setInputFile(java.io.File inputFile)
          setInputFile sets the value of inFile and tries to open a BufferedReader on that file.
 void setOptions(java.lang.String[] opts)
          store the options (i.e. processing hints) for the deciter to use and change its behaviour.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

java.io.BufferedReader in
in simply holds a reference to the input reader.

inFile

java.io.File inFile
inFile holds the file to which the input reader is to be connected.

id

java.lang.String id
id holds the identifier of the current article

options

java.lang.String[] options
options holds the set of hints that control the deciter process. It also holds all other options passed on the command line, and relies on the fact that the hints are uniquely recognisable.
Constructor Detail

OUTHarvester

public OUTHarvester()
Method Detail

setInputFile

public void setInputFile(java.io.File inputFile)
                  throws java.io.FileNotFoundException
setInputFile sets the value of inFile and tries to open a BufferedReader on that file.
Specified by:
setInputFile in interface com.bids.jol.loaders.CitationsHarvester
Parameters:
inputFile - the File object to which a Reader is to be opened.
Throws:
java.io.FileNotFoundException - if the file is non-existent

setArticleId

public void setArticleId(java.lang.String aid)
setArticleId sets the article id
Specified by:
setArticleId in interface com.bids.jol.loaders.CitationsHarvester
Parameters:
aid - the id to be used for this article

getInputFile

public java.io.File getInputFile()
getInputFile accessor method for inFile
Specified by:
getInputFile in interface com.bids.jol.loaders.CitationsHarvester
Returns:
File object to which the Reader is connected

getArticleId

public java.lang.String getArticleId()
getArticleId accessor method for the id
Specified by:
getArticleId in interface com.bids.jol.loaders.CitationsHarvester
Returns:
id of the current article

setOptions

public void setOptions(java.lang.String[] opts)
store the options (i.e. processing hints) for the deciter to use and change its behaviour. This is a little loose: it relies on the fact that the options processer in the deciter class ignores any options it doesn't recognise, hence will ignore the file names.
Specified by:
setOptions in interface com.bids.jol.loaders.CitationsHarvester
Parameters:
opts - array of string options as passed on the command line

harvest

public int harvest(java.io.BufferedWriter xmlOutput)
            throws java.io.IOException
Create the appropriate readers and writers, make a deciter object, set its hints/options and invoke its doit method to make it to do the dirty work.
Specified by:
harvest in interface com.bids.jol.loaders.CitationsHarvester