org.specrunner.dumper.core
Class AbstractSourceDumperFile

java.lang.Object
  extended by org.specrunner.source.core.EncodedImpl
      extended by org.specrunner.dumper.core.AbstractSourceDumperFile
All Implemented Interfaces:
ISourceDumper, IEncoded
Direct Known Subclasses:
SourceDumperCenter, SourceDumperDetails, SourceDumperResources, SourceDumperWritables

public abstract class AbstractSourceDumperFile
extends EncodedImpl
implements ISourceDumper

A partial dumper which writes data to files.

Author:
Thiago Santos

Field Summary
static int GAP
          Gap used to dump sources.
protected  File outputDirectory
          Default output directory.
protected  File outputFile
          Output file (absolute).
protected  String outputName
          Output file name.
 
Fields inherited from interface org.specrunner.source.IEncoded
DEFAULT_ENCODING, FEATURE_ENCODING
 
Constructor Summary
AbstractSourceDumperFile()
           
 
Method Summary
protected  void appendResources(File output)
          Append resources to a output file.
protected  void checkParent(File output)
          Check output directory.
protected  void clean(File file)
          Clean up directory files before dumping resources.
protected  String detailReport()
          Get detail report name.
 File getOutputDirectory()
          The output directory.
 File getOutputFile()
          Get output file.
 String getOutputName()
          The output file name.
protected  nu.xom.Serializer getSerializer(OutputStream fr)
          Gets document serializer.
protected  void outputDirectory()
          Gets output directory based on configuration or features.
protected  void outputName(ISource source)
          Set the output file for the source.
protected  void saveTo(nu.xom.Document doc, File output)
          Save a document to a output file.
protected  void set(ISource source, IResultSet result)
          Set source and result objects.
protected  void setFeatures(ISource source)
          Set features.
 void setOutputDirectory(File outputDirectory)
          Set the output directory.
 void setOutputFile(File outputFile)
          Set the output file.
 void setOutputName(String outputName)
          Set the output file name.
 
Methods inherited from class org.specrunner.source.core.EncodedImpl
getEncoding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.specrunner.dumper.ISourceDumper
dump
 
Methods inherited from interface org.specrunner.source.IEncoded
getEncoding
 

Field Detail

GAP

public static final int GAP
Gap used to dump sources.

See Also:
Constant Field Values

outputDirectory

protected File outputDirectory
Default output directory.


outputName

protected String outputName
Output file name.


outputFile

protected File outputFile
Output file (absolute).

Constructor Detail

AbstractSourceDumperFile

public AbstractSourceDumperFile()
Method Detail

set

protected void set(ISource source,
                   IResultSet result)
            throws SourceDumperException
Set source and result objects.

Parameters:
source - The source.
result - The result.
Throws:
SourceDumperException - On setting errors.

getOutputDirectory

public File getOutputDirectory()
The output directory.

Returns:
The output.

setOutputDirectory

public void setOutputDirectory(File outputDirectory)
Set the output directory.

Parameters:
outputDirectory - The new output.

getOutputName

public String getOutputName()
The output file name.

Returns:
The output name.

setOutputName

public void setOutputName(String outputName)
Set the output file name.

Parameters:
outputName - The output name.

getOutputFile

public File getOutputFile()
Get output file.

Returns:
The output file.

setOutputFile

public void setOutputFile(File outputFile)
Set the output file.

Parameters:
outputFile - The file.

setFeatures

protected void setFeatures(ISource source)
                    throws SourceDumperException
Set features.

Parameters:
source - The specification source.
Throws:
SourceDumperException - On dumper error.

outputDirectory

protected void outputDirectory()
                        throws SourceDumperException
Gets output directory based on configuration or features.

Throws:
SourceDumperException - On dumper error.

outputName

protected void outputName(ISource source)
                   throws SourceDumperException
Set the output file for the source.

Parameters:
source - The reference source.
Throws:
SourceDumperException - On dumper errors.

clean

protected void clean(File file)
              throws ResultException
Clean up directory files before dumping resources.

Parameters:
file - The reference file.
Throws:
ResultException - On cleanup errors.

detailReport

protected String detailReport()
Get detail report name.

Returns:
The detail report name.

getSerializer

protected nu.xom.Serializer getSerializer(OutputStream fr)
                                   throws UnsupportedEncodingException
Gets document serializer.

Parameters:
fr - The output stream.
Returns:
The serializer.
Throws:
UnsupportedEncodingException - On enconding errors.

saveTo

protected void saveTo(nu.xom.Document doc,
                      File output)
               throws SourceDumperException
Save a document to a output file.

Parameters:
doc - The document.
output - The target file.
Throws:
SourceDumperException - On dumper errors.

checkParent

protected void checkParent(File output)
                    throws SourceDumperException
Check output directory.

Parameters:
output - The output.
Throws:
SourceDumperException - On directory errors.

appendResources

protected void appendResources(File output)
                        throws SourceDumperException
Append resources to a output file.

Parameters:
output - The output file.
Throws:
SourceDumperException - On dumper errors.


Copyright © 2014. All rights reserved.