org.acm.seguin.pretty
Class PrettyPrintFile

java.lang.Object
  extended by org.acm.seguin.pretty.PrettyPrintFile
Direct Known Subclasses:
JEditPrettyPrinter, PrettyPrintString

public class PrettyPrintFile
extends java.lang.Object

Holds a refactoring. Default version just pretty prints the file.

Version:
$Id: PrettyPrintFile.java,v 1.12 2003/11/18 18:46:14 mikeatkinson Exp $
Author:
Chris Seguin, Mike Atkinson

Constructor Summary
PrettyPrintFile()
          Refactors java code.
 
Method Summary
 void apply(java.io.File inputFile)
          Apply the refactoring
 void apply(java.io.File inputFile, net.sourceforge.jrefactory.ast.SimpleNode root)
          Apply the refactoring
 net.sourceforge.jrefactory.factory.ParserFactory getParserFactory()
          Return the factory that gets the abstract syntax trees
protected  PrintData getPrintData(java.io.File input)
          Return the appropriate print data
protected  java.io.Writer getWriter(java.io.File file)
          Create the output stream
 boolean isApplicable(java.io.File inputFile)
          Returns true if this refactoring is applicable
protected  void postApply(java.io.File inputFile, net.sourceforge.jrefactory.ast.SimpleNode root)
          Apply the refactoring
 void setAsk(boolean way)
          Sets whether we should ask the user
 void setParserFactory(net.sourceforge.jrefactory.factory.ParserFactory factory)
          Set the parser factory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrettyPrintFile

public PrettyPrintFile()
Refactors java code.

Method Detail

setAsk

public void setAsk(boolean way)
Sets whether we should ask the user

Parameters:
way - the way to set the variable

setParserFactory

public void setParserFactory(net.sourceforge.jrefactory.factory.ParserFactory factory)
Set the parser factory

Parameters:
factory - Description of Parameter

isApplicable

public boolean isApplicable(java.io.File inputFile)
Returns true if this refactoring is applicable

Parameters:
inputFile - the input file
Returns:
true if this refactoring is applicable

getParserFactory

public net.sourceforge.jrefactory.factory.ParserFactory getParserFactory()
Return the factory that gets the abstract syntax trees

Returns:
the parser factory

apply

public void apply(java.io.File inputFile)
Apply the refactoring

Parameters:
inputFile - the input file

apply

public void apply(java.io.File inputFile,
                  net.sourceforge.jrefactory.ast.SimpleNode root)
Apply the refactoring

Parameters:
inputFile - the input file
root - Description of Parameter

getWriter

protected java.io.Writer getWriter(java.io.File file)
Create the output stream

Parameters:
file - the name of the file
Returns:
the output stream

getPrintData

protected PrintData getPrintData(java.io.File input)
Return the appropriate print data

Parameters:
input - Description of Parameter
Returns:
the print data

postApply

protected void postApply(java.io.File inputFile,
                         net.sourceforge.jrefactory.ast.SimpleNode root)
Apply the refactoring

Parameters:
inputFile - the input file
root - Description of Parameter