org.eclipse.xpand2.output
Class JavaBeautifier

java.lang.Object
  extended by org.eclipse.xpand2.output.JavaBeautifier
All Implemented Interfaces:
PostProcessor

public class JavaBeautifier
extends java.lang.Object
implements PostProcessor

Formats generated Java code using the Eclipse code formatter.

Since:
4.0

Constructor Summary
JavaBeautifier()
           
 
Method Summary
 void afterClose(FileHandle impl)
          Called after the file has been written.
 void beforeWriteAndClose(FileHandle info)
          Formats the file using Eclipse code formatter.
 java.lang.String getConfigFile()
           
protected  java.io.InputStream openStream(java.lang.String filename)
          Searches for the given filename as a ressource and returns a stream on it.
 void setConfigFile(java.lang.String configFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaBeautifier

public JavaBeautifier()
Method Detail

beforeWriteAndClose

public void beforeWriteAndClose(FileHandle info)
Formats the file using Eclipse code formatter. The file must have the extension '.java'.

Specified by:
beforeWriteAndClose in interface PostProcessor
Parameters:
info - A handle to the file that will be written

openStream

protected java.io.InputStream openStream(java.lang.String filename)
                                  throws java.io.IOException
Searches for the given filename as a ressource and returns a stream on it. Throws an IOException, if the file cannot be found.

Parameters:
filename - The name of the file to be searched in the ressources.
Returns:
InputStream for subsequent reading
Throws:
java.io.IOException

getConfigFile

public java.lang.String getConfigFile()
Returns:
the configuration file for the formatter

setConfigFile

public void setConfigFile(java.lang.String configFile)
Parameters:
configFile - configuration file for the formatter

afterClose

public void afterClose(FileHandle impl)
Called after the file has been written.

Specified by:
afterClose in interface PostProcessor
Parameters:
impl - A handle to the file that has been written

Copyright 2007 committers of openArchitectureWare and others.
All Rights Reserved.