org.tridas.io
Class AbstractDendroCollectionWriter

java.lang.Object
  extended by org.tridas.io.AbstractDendroCollectionWriter
Direct Known Subclasses:
BelfastAppleWriter, BesanconWriter, CatrasWriter, CorinaWriter, CSVMatrixWriter, CSVWriter, ExcelMatrixWriter, HeidelbergWriter, NottinghamWriter, ODFMatrixWriter, OOXMLWriter, OxfordWriter, Past4Writer, SheffieldWriter, TophamWriter, TridasWriter, TrimsWriter, TucsonCompactWriter, TucsonWriter, VFormatWriter

public abstract class AbstractDendroCollectionWriter
extends Object

Author:
Daniel Murphy

Constructor Summary
AbstractDendroCollectionWriter(Class<? extends IMetadataFieldSet> argDefaultFieldsClass)
           
 
Method Summary
protected  void addToFileList(IDendroFile df)
          Add DendroFile to list of files to write
 void addWarning(ConversionWarning warning)
          Add a warning to our list of ConversionWarnings
 void clearFiles()
          Clears the file list
 void clearWarnings()
          Clear warning list
 IMetadataFieldSet constructDefaultMetadata()
          Construct the default metadata fields
abstract  IMetadataFieldSet getDefaults()
          Get the default values for this writer.
abstract  String getDescription()
          Get the description of the format
protected  ArrayList<IDendroFile> getFileList()
          Get the list of DendroFiles that are associated with this CollectionWriter
 IDendroFile[] getFiles()
          Get the IDendroFiles generated from loading this project
abstract  String getFullName()
          Get the full name of the format
abstract  INamingConvention getNamingConvention()
          Get the naming convention
abstract  String getShortName()
          Get the short name of the format
 ConversionWarning[] getWarnings()
          Get a list of conversion warnings for this Collection writer
 void load(org.tridas.schema.TridasProject argProject)
          Loads a TRiDaS project to convert into a legacy format, using the default metadata set
 void load(org.tridas.schema.TridasProject argProject, IMetadataFieldSet argDefaults)
          Loads a TRiDaS project to convert into a legacy format, using the given metadata set
 void load(org.tridas.schema.TridasTridas argContainer)
          Loads a tridas container to convert into a legacy format, using the default metadata set
 void load(org.tridas.schema.TridasTridas argContainer, IMetadataFieldSet argDefaults)
          Loads a container to convert into a legacy format, using the given metadata set
 void loadProject(org.tridas.schema.TridasProject argProject)
          Deprecated. @see org.tridas.io.AbstractDendroCollectionWriter#load(org.tridas.schema.TridasProject)
 void loadProject(org.tridas.schema.TridasProject argProject, IMetadataFieldSet argDefaults)
          Deprecated. @see org.tridas.io.AbstractDendroCollectionWriter#load(org.tridas.schema.TridasProject, org.tridas.io.default.IMetadataFieldSet)
protected  void parseTridasContainer(org.tridas.schema.TridasTridas argContainer, IMetadataFieldSet argDefaults)
          Parse the TRiDaS container with the given defaults
protected abstract  void parseTridasProject(org.tridas.schema.TridasProject argProject, IMetadataFieldSet argDefaults)
          Parse the project with the given defaults
 void saveAllToDisk()
          Save all associated files to the disk in the same folder as the jar.
 void saveAllToDisk(String argOutputFolder)
          Save all associated files to the disk
 void saveFileToDisk(String argOutputFolder, IDendroFile argFile)
          Used specify where to save each file individually.
protected  void saveFileToDisk(String argOutputFolder, String argFilename, IDendroFile argFile)
          Override to implement own file saving.
abstract  void setNamingConvention(INamingConvention argConvension)
          Set the naming convention.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDendroCollectionWriter

public AbstractDendroCollectionWriter(Class<? extends IMetadataFieldSet> argDefaultFieldsClass)
Parameters:
argDefaultFieldsClass -
Method Detail

load

public void load(org.tridas.schema.TridasTridas argContainer)
          throws IncompleteTridasDataException,
                 ConversionWarningException
Loads a tridas container to convert into a legacy format, using the default metadata set

Parameters:
argProject -
Throws:
IncompleteTridasDataException
ConversionWarningException

constructDefaultMetadata

public IMetadataFieldSet constructDefaultMetadata()
Construct the default metadata fields

Returns:

load

public void load(org.tridas.schema.TridasTridas argContainer,
                 IMetadataFieldSet argDefaults)
          throws IncompleteTridasDataException,
                 ConversionWarningException,
                 IncorrectDefaultFieldsException
Loads a container to convert into a legacy format, using the given metadata set

Parameters:
argContainer -
argDefaults -
Throws:
IncompleteTridasDataException
ConversionWarningException
IncorrectDefaultFieldsException

load

public void load(org.tridas.schema.TridasProject argProject,
                 IMetadataFieldSet argDefaults)
          throws IncompleteTridasDataException,
                 ConversionWarningException,
                 IncorrectDefaultFieldsException
Loads a TRiDaS project to convert into a legacy format, using the given metadata set

Parameters:
argProject -
argDefaults -
Throws:
IncompleteTridasDataException
ConversionWarningException
IncorrectDefaultFieldsException

load

public void load(org.tridas.schema.TridasProject argProject)
          throws IncompleteTridasDataException,
                 ConversionWarningException
Loads a TRiDaS project to convert into a legacy format, using the default metadata set

Parameters:
argProject -
Throws:
IncompleteTridasDataException
ConversionWarningException

loadProject

public void loadProject(org.tridas.schema.TridasProject argProject,
                        IMetadataFieldSet argDefaults)
                 throws IncompleteTridasDataException,
                        ConversionWarningException,
                        IncorrectDefaultFieldsException
Deprecated. @see org.tridas.io.AbstractDendroCollectionWriter#load(org.tridas.schema.TridasProject, org.tridas.io.default.IMetadataFieldSet)

Deprecated. Use load(TridasProject argProject, IMetadataFieldSet argDefaults) instead

Parameters:
argProject -
argDefaults -
Throws:
IncompleteTridasDataException
ConversionWarningException
IncorrectDefaultFieldsException

loadProject

public void loadProject(org.tridas.schema.TridasProject argProject)
                 throws IncompleteTridasDataException,
                        ConversionWarningException
Deprecated. @see org.tridas.io.AbstractDendroCollectionWriter#load(org.tridas.schema.TridasProject)

Deprecated. Use load(TridasProject argProject) instead

Parameters:
argProject -
Throws:
IncompleteTridasDataException
ConversionWarningException

parseTridasProject

protected abstract void parseTridasProject(org.tridas.schema.TridasProject argProject,
                                           IMetadataFieldSet argDefaults)
                                    throws IncompleteTridasDataException,
                                           ConversionWarningException
Parse the project with the given defaults

Parameters:
argProject -
argDefaults -
Throws:
IncompleteTridasDataException
ConversionWarningException

parseTridasContainer

protected void parseTridasContainer(org.tridas.schema.TridasTridas argContainer,
                                    IMetadataFieldSet argDefaults)
                             throws IncompleteTridasDataException,
                                    ConversionWarningException
Parse the TRiDaS container with the given defaults

Parameters:
argContainer -
argDefaults -
Throws:
IncompleteTridasDataException
ConversionWarningException

getFileList

protected ArrayList<IDendroFile> getFileList()
Get the list of DendroFiles that are associated with this CollectionWriter

Returns:

getFiles

public IDendroFile[] getFiles()
Get the IDendroFiles generated from loading this project

Returns:

saveAllToDisk

public void saveAllToDisk()
Save all associated files to the disk in the same folder as the jar.


saveAllToDisk

public void saveAllToDisk(String argOutputFolder)
Save all associated files to the disk

Parameters:
argOutputFolder - the folder to save the files to

saveFileToDisk

public void saveFileToDisk(String argOutputFolder,
                           IDendroFile argFile)
Used specify where to save each file individually.

Parameters:
argOutputFolder -
argFile - must be a file from this writer
Throws:
RuntimeException - if the file is not in this writer's filelist

saveFileToDisk

protected void saveFileToDisk(String argOutputFolder,
                              String argFilename,
                              IDendroFile argFile)
Override to implement own file saving. Make sure to respect TridasIO.getWritingCharset().

Parameters:
argOutputFolder - output folder can be absolute, and always ends with "/" unless it's an empty string
argFilename - filename of the file (without extension)
argFile - a dendro file of this writer

addToFileList

protected void addToFileList(IDendroFile df)
Add DendroFile to list of files to write

Parameters:
df -

clearFiles

public void clearFiles()
Clears the file list


getWarnings

public ConversionWarning[] getWarnings()
Get a list of conversion warnings for this Collection writer

Returns:

addWarning

public void addWarning(ConversionWarning warning)
Add a warning to our list of ConversionWarnings

Parameters:
warning -

clearWarnings

public void clearWarnings()
Clear warning list


setNamingConvention

public abstract void setNamingConvention(INamingConvention argConvension)
Set the naming convention.

Parameters:
argConvension -

getNamingConvention

public abstract INamingConvention getNamingConvention()
Get the naming convention

Returns:

getShortName

public abstract String getShortName()
Get the short name of the format

Returns:

getFullName

public abstract String getFullName()
Get the full name of the format

Returns:

getDescription

public abstract String getDescription()
Get the description of the format

Returns:

getDefaults

public abstract IMetadataFieldSet getDefaults()
Get the default values for this writer.

Returns:


Copyright © 2011. All Rights Reserved.