uk.ac.cam.spectra
Class DataProcess

java.lang.Object
  extended by uk.ac.cam.spectra.DataProcess

public class DataProcess
extends java.lang.Object

Data object that holds input data, processing instructions and output data for file processing. The reason for modelling the processing instructions this way (rather than e.g. as method calls) is that this allows implementations to perform combinations of procedures (a common use case) efficiently, by reusing intermediate data structures and avoiding repeated validations, for example. The class holds both input data, output data and processing instructions to allow further efficiencies, e.g. allowing clients to pass in a pre-converted CML. It also allows various efficiencies and flexibilities on the part of the file handling component.

Author:
Jim Downing

Constructor Summary
DataProcess()
           
 
Method Summary
 nu.xom.Document getConvertedCml()
           
 com.hp.hpl.jena.rdf.model.Model getExtractedMetadata()
           
 java.lang.String getMetadataPackageUri()
          Accessor for the metadataPackageUri.
 boolean getPerformConversion()
          Accessor for the conversion processing instruction flag.
 boolean getPerformExtraction()
          Accessor for the metadata extraction processing instruction flag.
 boolean getPerformValidation()
          Accessor for the metadata extraction processing instruction flag.
 java.io.File getSourceFile()
          Accessor for the sourceFile field.
 Validation getValidation()
          Returns the results of any validation performed.
 void setConvertedCml(nu.xom.Document convertedCml)
          Accessor for the converted CML.
 void setExtractedMetadata(com.hp.hpl.jena.rdf.model.Model extractedMetadata)
          Accessor for the extracted metadata.
 void setMetadataPackageUri(java.lang.String metadataPackageUri)
          Accessor for the metadata package URI.
 void setPerformConversion(boolean performConversion)
          Accessor for conversion processing instruction flag.
 void setPerformExtraction(boolean performExtraction)
          Accessor for conversion processing instruction flag.
 void setPerformValidation(boolean performValidation)
           
 void setSourceFile(java.io.File sourceFile)
           
 void setValidation(Validation validation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataProcess

public DataProcess()
Method Detail

getConvertedCml

public nu.xom.Document getConvertedCml()

getExtractedMetadata

public com.hp.hpl.jena.rdf.model.Model getExtractedMetadata()
Returns:
A Jena model including statements that can have the package and or individual files as subject resources. The model may be empty but must not be null.

getMetadataPackageUri

public java.lang.String getMetadataPackageUri()
Accessor for the metadataPackageUri.

Returns:

getSourceFile

public java.io.File getSourceFile()
Accessor for the sourceFile field.

Returns:
the source file, may be null if not set or set to null.

getValidation

public Validation getValidation()
Returns the results of any validation performed.

Returns:
A validation object (must not return null). If a validation fails, then an exception should be raised from the process() method.

getPerformConversion

public boolean getPerformConversion()
Accessor for the conversion processing instruction flag.

Returns:

getPerformExtraction

public boolean getPerformExtraction()
Accessor for the metadata extraction processing instruction flag.

Returns:

getPerformValidation

public boolean getPerformValidation()
Accessor for the metadata extraction processing instruction flag.

Returns:

setConvertedCml

public void setConvertedCml(nu.xom.Document convertedCml)
Accessor for the converted CML. Most of the time this won't be used, but is useful if a DataFileType implementation indicates that it extracts metadata from resulting CML (rather than directly from the source file). Normally should only be used by DataFileType implementations.

Parameters:
convertedCml -

setExtractedMetadata

public void setExtractedMetadata(com.hp.hpl.jena.rdf.model.Model extractedMetadata)
Accessor for the extracted metadata. Should only be used by DataFileType implementations.

Parameters:
extractedMetadata -

setMetadataPackageUri

public void setMetadataPackageUri(java.lang.String metadataPackageUri)
Accessor for the metadata package URI. Should be called by clients who wish to perform metadata extractions.

Parameters:
metadataPackageUri -

setPerformConversion

public void setPerformConversion(boolean performConversion)
Accessor for conversion processing instruction flag.

Parameters:
performConversion -

setPerformExtraction

public void setPerformExtraction(boolean performExtraction)
Accessor for conversion processing instruction flag.

Parameters:
performExtraction -

setPerformValidation

public void setPerformValidation(boolean performValidation)

setSourceFile

public void setSourceFile(java.io.File sourceFile)

setValidation

public void setValidation(Validation validation)


Copyright © 2006-2007 The SPECTRa Project. All Rights Reserved.