git-svn-id: http://google-refine.googlecode.com/svn/trunk@2295 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Tom Morris 2011-10-07 18:56:23 +00:00
parent 4a230abb44
commit 50927b33dc

View File

@ -51,6 +51,10 @@ import com.google.refine.importing.ImportingUtilities;
import com.google.refine.model.Project; import com.google.refine.model.Project;
import com.google.refine.util.JSONUtilities; import com.google.refine.util.JSONUtilities;
/**
* Abstract class for importer parsers which handle tree-shaped data
* (currently XML & JSON).
*/
abstract public class TreeImportingParserBase implements ImportingParser { abstract public class TreeImportingParserBase implements ImportingParser {
final protected boolean useInputStream; final protected boolean useInputStream;
@ -128,6 +132,12 @@ abstract public class TreeImportingParserBase implements ImportingParser {
} }
} }
/**
* Parse a single file from a Reader.
*
* The default implementation just throws a NotImplementedException.
* Override in subclasses to implement.
*/
public void parseOneFile( public void parseOneFile(
Project project, Project project,
ProjectMetadata metadata, ProjectMetadata metadata,
@ -142,6 +152,12 @@ abstract public class TreeImportingParserBase implements ImportingParser {
throw new NotImplementedException(); throw new NotImplementedException();
} }
/**
* Parse a single file from an InputStream.
*
* The default implementation just throws a NotImplementedException.
* Override in subclasses to implement.
*/
public void parseOneFile( public void parseOneFile(
Project project, Project project,
ProjectMetadata metadata, ProjectMetadata metadata,
@ -156,6 +172,10 @@ abstract public class TreeImportingParserBase implements ImportingParser {
throw new NotImplementedException(); throw new NotImplementedException();
} }
/**
* Parse a single file from a TreeReader.
*
*/
protected void parseOneFile( protected void parseOneFile(
Project project, Project project,
ProjectMetadata metadata, ProjectMetadata metadata,