Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.jasper.compiler
Class Compiler

    java.lang.Object
      org.apache.jasper.compiler.Compiler

Direct Known Subclasses:
  CommandLineCompiler, JspCompiler

public class Compiler
extends java.lang.Object

If you want to customize JSP compilation aspects, this class is something you should take a look at. Hope is that people can just extend Compiler and override things like isOutDated() but inherit things like compile(). This might change.

Author:
  Anil K. Vijendran, Mandar Raje

Field Summary
`protected JspCompilationContext` | `ctxt`
`protected JavaCompiler` | `javac`
`protected Mangler` | `mangler`

Constructor Summary
`Compiler(JspCompilationContext ctxt)`

Method Summary
`java.lang.String` | `changeEncodingIfNecessary(JspReader tmpReader)` Change the encoding for the reader if specified.
`boolean` | `compile()` Compile the jsp file from the current engine context
`void` | `computeServletClassName()`
`boolean` | `isOutDated()` This is a protected method intended to be overridden by subclasses of Compiler.
`void` | `removeGeneratedFiles()` Remove generated files
`void` | `setJavaCompiler(JavaCompiler javac)` Set java compiler info
`void` | `setMangler(Mangler mangler)` Set Mangler which will be used as part of compile().

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### javac

    protected JavaCompiler javac

### mangler

    protected Mangler mangler

### ctxt

    protected JspCompilationContext ctxt

Constructor Detail

### Compiler

    public Compiler(JspCompilationContext ctxt)

Method Detail

### compile

    public boolean compile()
                    throws java.io.FileNotFoundException,
                           JasperException,
                           java.lang.Exception

  Compile the jsp file from the current engine context

  Returns:
    true if the class file was outdated the jsp file was recompiled.
  Throws:
    `java.io.FileNotFoundException`
    `JasperException`
    `java.lang.Exception`

### computeServletClassName

    public void computeServletClassName()

### isOutDated

    public boolean isOutDated()

  This is a protected method intended to be overridden by subclasses of Compiler. This is used by the compile method to do all the compilation.

### setJavaCompiler

    public void setJavaCompiler(JavaCompiler javac)

  Set java compiler info

### setMangler

    public void setMangler(Mangler mangler)

  Set Mangler which will be used as part of compile().

### changeEncodingIfNecessary

    public java.lang.String changeEncodingIfNecessary(JspReader tmpReader)
                                               throws ParseException

  Change the encoding for the reader if specified.

  Throws:
    `ParseException`

### removeGeneratedFiles

    public void removeGeneratedFiles()

  Remove generated files

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001 Apache Software Foundation. All Rights Reserved.