| Revision 24567,
1.5 KB
checked in by julie, 13 months ago
(diff) |
|
update copyright notice
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | package org.intermine.dataconversion; |
|---|
| 2 | |
|---|
| 3 | /* |
|---|
| 4 | * Copyright (C) 2002-2011 FlyMine |
|---|
| 5 | * |
|---|
| 6 | * This code may be freely distributed and modified under the |
|---|
| 7 | * terms of the GNU Lesser General Public Licence. This should |
|---|
| 8 | * be distributed with the code. See the LICENSE file for more |
|---|
| 9 | * information or http://www.gnu.org/copyleft/lesser.html. |
|---|
| 10 | * |
|---|
| 11 | */ |
|---|
| 12 | |
|---|
| 13 | import java.io.File; |
|---|
| 14 | import java.io.Reader; |
|---|
| 15 | |
|---|
| 16 | import org.intermine.metadata.Model; |
|---|
| 17 | |
|---|
| 18 | /** |
|---|
| 19 | * Parent class for DataConverters that read from files |
|---|
| 20 | * @author Mark Woodbridge |
|---|
| 21 | */ |
|---|
| 22 | public abstract class FileConverter extends DataConverter |
|---|
| 23 | { |
|---|
| 24 | private File currentFile; |
|---|
| 25 | |
|---|
| 26 | /** |
|---|
| 27 | * Constructor |
|---|
| 28 | * @param writer the Writer used to output the resultant items |
|---|
| 29 | * @param model the data model |
|---|
| 30 | */ |
|---|
| 31 | public FileConverter(ItemWriter writer, Model model) { |
|---|
| 32 | super(writer, model); |
|---|
| 33 | } |
|---|
| 34 | |
|---|
| 35 | /** |
|---|
| 36 | * Perform the currentFile conversion |
|---|
| 37 | * @param reader BufferedReader used as input |
|---|
| 38 | * @throws Exception if an error occurs during processing |
|---|
| 39 | */ |
|---|
| 40 | public abstract void process(Reader reader) throws Exception; |
|---|
| 41 | |
|---|
| 42 | /** |
|---|
| 43 | * Set the current File that is being processed. Called by FileConverterTask.execute(). |
|---|
| 44 | * @param currentFile the current File that is being processed |
|---|
| 45 | */ |
|---|
| 46 | public void setCurrentFile(File currentFile) { |
|---|
| 47 | this.currentFile = currentFile; |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | /** |
|---|
| 51 | * Return the File that is currently being converted. |
|---|
| 52 | * @return the current File |
|---|
| 53 | */ |
|---|
| 54 | public File getCurrentFile() { |
|---|
| 55 | return currentFile; |
|---|
| 56 | } |
|---|
| 57 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.