net.sf.jlayercheck.out.html
Class SourceCodeDecorator

java.lang.Object
  extended by net.sf.jlayercheck.out.html.SourceCodeDecorator

public class SourceCodeDecorator
extends Object

Generates the decorated source code as HTML.


Field Summary
protected  VelocityGenerator generator
          The generator to use
protected  File outputDir
          The output directory
protected  File outputFile
          The output file, not necessarily in outputDir
static String PACKAGE
          Name of this package
static String TEMPLATENAME
          Template to use
 
Constructor Summary
SourceCodeDecorator(File outputDir, File outputFile)
           
 
Method Summary
 String convert2HTML(URL sourcefile)
          Use java2html to parse the source.
 Object copyResource(String resourcename)
          Copy resource to outputDir.
 void generate()
           
 File getOutputDir()
           
 File getOutputFile()
           
 List<String> parseHTML(String htmlCode)
          Separates source lines from java2html's HTML code.
protected  void prepareContext()
          Prepare velocity context for generator and template.
 void setOutputDir(File outputDir)
           
 void setOutputFile(File outputFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PACKAGE

public static final String PACKAGE
Name of this package


TEMPLATENAME

public static final String TEMPLATENAME
Template to use


generator

protected VelocityGenerator generator
The generator to use


outputDir

protected File outputDir
The output directory


outputFile

protected File outputFile
The output file, not necessarily in outputDir

Constructor Detail

SourceCodeDecorator

public SourceCodeDecorator(File outputDir,
                           File outputFile)
Method Detail

setOutputFile

public void setOutputFile(File outputFile)

getOutputFile

public File getOutputFile()

setOutputDir

public void setOutputDir(File outputDir)

getOutputDir

public File getOutputDir()

prepareContext

protected void prepareContext()
Prepare velocity context for generator and template.


convert2HTML

public String convert2HTML(URL sourcefile)
                    throws IOException
Use java2html to parse the source.

Parameters:
sourcefile - The URL of the java source file
Returns:
The source as HTML
Throws:
IOException

parseHTML

public List<String> parseHTML(String htmlCode)
Separates source lines from java2html's HTML code.

Parameters:
htmlCode - the HTML code
Returns:
A list of source lines as HTML fragments

generate

public void generate()

copyResource

public Object copyResource(String resourcename)
Copy resource to outputDir.

Parameters:
resourcename - the resource
Returns:
always null


Copyright © 2007. All Rights Reserved.