org.archiviststoolkit.importer
Class XmlImportHandler

java.lang.Object
  extended by org.archiviststoolkit.importer.ImportHandler
      extended by org.archiviststoolkit.importer.XmlImportHandler
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
XmlEacNameImportHandler, XmlOliviaNameImportHandler

public abstract class XmlImportHandler
extends ImportHandler

Base class for all CSV derived import handlers.


Field Summary
static char DEFAULT_SEP
          The default separator.
protected  java.lang.String recordTag
           
 
Fields inherited from class org.archiviststoolkit.importer.ImportHandler
file, importController
 
Constructor Summary
XmlImportHandler()
          Constructor.
 
Method Summary
 java.util.ArrayList getColumnList()
          Get the list of columns.
 java.lang.String getSourceApplication()
          Get the source application name.
abstract  java.lang.Object handleInstance(java.lang.String xmlInstanceString)
          Handle a newly parsed row.
 boolean importFile(java.io.File file, DomainImportController domainController, InfiniteProgressPanel progressPanel)
          Import the file.
 boolean importFile(java.io.File file, DomainImportController domainController, java.lang.String recordTag, InfiniteProgressPanel progressPanel)
          Import the file.
 boolean isAutoCompleteOn()
          is autocomplete on.
abstract  java.util.ArrayList mapColumn(java.util.ArrayList dataList)
          Map a column.
 java.util.List parse(java.lang.String line)
          parse: break the input String into fields.
 void purify(java.util.ArrayList arrayList)
          Clean the datalist.
 void setColumnList(java.util.ArrayList columnList)
          Set the list of columns.
 void setSourceApplication(java.lang.String sourceApplication)
          Set the source application name.
 boolean startImportThread(java.io.File importFile, DomainImportController controller, java.lang.String recordTag)
          Kick off the import thread.
 
Methods inherited from class org.archiviststoolkit.importer.ImportHandler
canImportFile, getFile, getImportController, getInitialChunk, run, startImportThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SEP

public static final char DEFAULT_SEP
The default separator.

See Also:
Constant Field Values

recordTag

protected java.lang.String recordTag
Constructor Detail

XmlImportHandler

public XmlImportHandler()
Constructor.

Method Detail

mapColumn

public abstract java.util.ArrayList mapColumn(java.util.ArrayList dataList)
Map a column.

Parameters:
dataList - the datalist
Returns:
a column

handleInstance

public abstract java.lang.Object handleInstance(java.lang.String xmlInstanceString)
                                         throws UnknownLookupListException
Handle a newly parsed row.

Returns:
the constructed domain object
Throws:
UnknownLookupListException

getSourceApplication

public java.lang.String getSourceApplication()
Get the source application name.

Returns:
the name of the source application

setSourceApplication

public void setSourceApplication(java.lang.String sourceApplication)
Set the source application name.

Parameters:
sourceApplication - the name of the source application

setColumnList

public void setColumnList(java.util.ArrayList columnList)
Set the list of columns.

Parameters:
columnList - the list of columns.

getColumnList

public java.util.ArrayList getColumnList()
Get the list of columns.

Returns:
the list of columns.

isAutoCompleteOn

public boolean isAutoCompleteOn()
is autocomplete on.

Returns:
autocomplete status.

startImportThread

public boolean startImportThread(java.io.File importFile,
                                 DomainImportController controller,
                                 java.lang.String recordTag)
Kick off the import thread.

Parameters:
importFile - the file to import
controller - the controller to use.
Returns:
if we succeeded or not

importFile

public boolean importFile(java.io.File file,
                          DomainImportController domainController,
                          InfiniteProgressPanel progressPanel)
Description copied from class: ImportHandler
Import the file.

Specified by:
importFile in class ImportHandler
Parameters:
file - the file to import.
domainController - the controller to use.
Returns:
if we succeded

importFile

public boolean importFile(java.io.File file,
                          DomainImportController domainController,
                          java.lang.String recordTag,
                          InfiniteProgressPanel progressPanel)
Import the file.

Parameters:
file - the file to import.
domainController - which controller to use.
Returns:
if the import succeded.

parse

public java.util.List parse(java.lang.String line)
parse: break the input String into fields.

Parameters:
line - the line to parse
Returns:
java.util.Iterator containing each field from the original as a String, in order.

purify

public void purify(java.util.ArrayList arrayList)
Clean the datalist.

Parameters:
arrayList - the list to be cleansed.