freemarker.ext.misc
Class JavaToHtml

java.lang.Object
  extended by freemarker.ext.misc.JavaToHtml
All Implemented Interfaces:
TemplateModel, TemplateTransformModel2, java.io.Serializable

public final class JavaToHtml
extends java.lang.Object
implements TemplateTransformModel2, java.io.Serializable

A FM-Classic transformer that performs syntax colouring of Java source files, and outputs the results in HTML. The HTML is HTML 3.2 compliant, though later transitional DTDs should have no problems with this code.

The transformation uses the Jakarta ORO regular expression library, available from the Jakarta Apache web site.

Version:
$Id: JavaToHtml.java 1152 2013-04-15 10:34:50Z run2000 $
Author:
Nicholas Cull
See Also:
Serialized Form

Constructor Summary
JavaToHtml()
          Creates new JavaToHtml
 
Method Summary
 boolean isEmpty()
          Is the object empty?
 void transform(java.io.Reader source, java.io.Writer output)
          Performs a transformation/filter on FM-Classic output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaToHtml

public JavaToHtml()
Creates new JavaToHtml

Method Detail

transform

public void transform(java.io.Reader source,
                      java.io.Writer output)
               throws java.io.IOException,
                      TemplateModelException
Performs a transformation/filter on FM-Classic output.

Specified by:
transform in interface TemplateTransformModel2
Parameters:
source - the input to be transformed
output - the destination of the transformation
Throws:
java.io.IOException
TemplateModelException

isEmpty

public boolean isEmpty()
Is the object empty?

Specified by:
isEmpty in interface TemplateModel
Returns:
false, to indicate this object is not empty