simple.page.translate
Class Translator

java.lang.Object
  extended by simple.page.translate.Translator

public class Translator
extends java.lang.Object

The Translator object is used to translate a JSP source file to a Java or Groovy source file. The translation process can be brokwn up into two phases, these are the build phase and the generation phase. In the build phase the document is parsed and a document definition is created as a Definition object.

The generation pahse uses the document definition constructed by the build phase to generate the Java or Groovy source required to compile the page into a usable, loadable object.,

Author:
Niall Gallagher
See Also:
Compiler

Constructor Summary
Translator(Workspace project)
          Constructor for the Translator object.
 
Method Summary
 Source translate(java.lang.String target)
          This method performs the translation of the JSP source file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Translator

public Translator(Workspace project)
Constructor for the Translator object. This needs a workspace configuration in order to gather and compile the JSP sources. All JSP sources will be gathered from the workspace and written to a build path provided by the workspace.

Parameters:
project - this provides a workspace for translation
Method Detail

translate

public Source translate(java.lang.String target)
                 throws java.lang.Exception
This method performs the translation of the JSP source file. The source file is translated as part of a two phase process. First the JSP file is build into a collection or code segments. Then the source is generated in the runtime language required. The possible runtime languages are Groovy and Java.

Parameters:
target - this is the JSP source file to be translated
Throws:
java.lang.Exception