org.inria.ns.reflex.xml.translet
Class Compile

java.lang.Object
  extended by org.inria.ns.reflex.xml.translet.Compile

public class Compile
extends Object

Compiles an XSLT stylesheet to a JAR file.

This compiler performs almost the same as the XSLTC compiler, but the main class is an instance of Templates and can be used directly like when using JAXP.

Author:
Philippe Poulard

Constructor Summary
Compile(InputSource stylesheet, File workDir, String className)
          Prepare the compilation of a stylesheet to a set of classes.
 
Method Summary
 void compile()
          Perform the compilation.
 void createJar(String jarFileName)
          Create a JAR file.
static void main(String[] args)
          Compile a stylesheet to bytecode classes to store in a new JAR file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Compile

public Compile(InputSource stylesheet,
               File workDir,
               String className)
Prepare the compilation of a stylesheet to a set of classes.

Parameters:
stylesheet - The input stylesheet to compile.
workDir - The working directory.
className - The qualified name of the class to create, e.g. "org.acme.foo.MyTemplates".
See Also:
compile()
Method Detail

compile

public void compile()
             throws Exception
Perform the compilation.

Throws:
Exception
See Also:
Templates

createJar

public void createJar(String jarFileName)
               throws FileNotFoundException,
                      IOException
Create a JAR file.

Parameters:
jarFileName - The JAR file name to create in the working directory.
Throws:
FileNotFoundException
IOException

main

public static void main(String[] args)
                 throws Exception
Compile a stylesheet to bytecode classes to store in a new JAR file.

Usage: java -cp reflex-n.n.n.jar org.inria.ns.reflex.xml.translet.Compile [stylesheet] [workDir] [qualifiedClassName] [jarFileName]

If the last argument is missing, the JAR file is not created. [jarFileName] is the name of the JAR file relative to the working directory.

Example: java -cp reflex-n.n.n.jar org.inria.ns.reflex.xml.translet.Compile src/tutorial/basic/hello/example.xsl src/tutorial/basic/translet/WEB-INF/lib/ org.acme.translet.Example example.jar

Parameters:
args - Arguments: [stylesheet] [workDir] [qualifiedClassName] [jarFileName]
Throws:
Exception