pmp.io
Class FileIO

java.lang.Object
  extended by pmp.Macroprocessor.Component
      extended by pmp.InputOutput
          extended by pmp.io.FileIO

public class FileIO
extends InputOutput

Implements filesystem InputOutput.

Title: PMP: Macroprocessor

Description: Java macroprocessor

Copyright: Copyright (c) 2005

Version:
1.0
Author:
Luděk Hlaváček

Field Summary
protected  boolean closeableOut
          Should be output closed when nott needed.
protected  java.io.Writer output
          Current output
 
Fields inherited from class pmp.InputOutput
ERR_OUTPUT, NULL_INPUT, NULL_OUTPUT, RANDOM_INPUT, STD_INPUT, STD_OUTPUT
 
Constructor Summary
FileIO(Macroprocessor mp, java.lang.String outputFile, boolean assign)
           
 
Method Summary
 void closeFiles(boolean force)
          Close output file.
 void debugHandler(java.lang.String debugmessage)
           
 void errorHandler(java.lang.String error)
          This method should produce some kind of error message and then raise FatalParserException.
 InputSource getDefaultInput()
          This class doesn't provide default input source.
 InputSource getInput(java.lang.String inputFile)
          Return new Input object for given source.
 void noticeHandler(java.lang.String noticemessage)
           
 void setOutput(java.lang.String outputFile)
          Redirects output of macroprocessor to specified location.
 void warningHandler(java.lang.String warning)
           
 void write(java.lang.String str)
          Writes given string into output writer.
 
Methods inherited from class pmp.Macroprocessor.Component
error, getMP, getMPAnalyzer, getMPIO, getMPIQ, getMPMacros, notice, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

output

protected java.io.Writer output
Current output


closeableOut

protected boolean closeableOut
Should be output closed when nott needed. Set to false when using stdio.

Constructor Detail

FileIO

public FileIO(Macroprocessor mp,
              java.lang.String outputFile,
              boolean assign)
Method Detail

getInput

public InputSource getInput(java.lang.String inputFile)
Description copied from class: InputOutput
Return new Input object for given source. Must be reimplemented by subclasses.

Overrides:
getInput in class InputOutput
Parameters:
inputFile - name of source
Returns:
returns InputSource object for given source

getDefaultInput

public InputSource getDefaultInput()
This class doesn't provide default input source.

Overrides:
getDefaultInput in class InputOutput
Returns:
null

setOutput

public void setOutput(java.lang.String outputFile)
Description copied from class: InputOutput
Redirects output of macroprocessor to specified location. Must be reimplemented by subclasses.

Overrides:
setOutput in class InputOutput
Parameters:
outputFile - name of output

write

public void write(java.lang.String str)
Writes given string into output writer.

Overrides:
write in class InputOutput
Parameters:
str - string to be written to output

closeFiles

public void closeFiles(boolean force)
Close output file.

Parameters:
force - close file even if it is marked as not closeable.

errorHandler

public void errorHandler(java.lang.String error)
Description copied from class: InputOutput
This method should produce some kind of error message and then raise FatalParserException.

Overrides:
errorHandler in class InputOutput
Parameters:
error - error message

warningHandler

public void warningHandler(java.lang.String warning)
Overrides:
warningHandler in class InputOutput

noticeHandler

public void noticeHandler(java.lang.String noticemessage)
Overrides:
noticeHandler in class InputOutput

debugHandler

public void debugHandler(java.lang.String debugmessage)
Overrides:
debugHandler in class InputOutput