org.apache.jasper.compiler
Class JasperMangler

java.lang.Object
  extended byorg.apache.jasper.compiler.JasperMangler
All Implemented Interfaces:
Mangler

public class JasperMangler
extends java.lang.Object
implements Mangler

Mangler implementation - use the directory of the jsp file as a package name, minimize "special" encoding - in general, simpler and predictible names for the common case. This file is also using a special mechanism for the "versioned" classes ( based on Anil's idea of generating new class each time the jsp file changes - without a context restart that looses data ). We use an additional file per jsp saving the current version - at startup the file will be read to avoid recompilation. That removes the need for a "special" class loader and the hacks in reading internal class info.


Constructor Summary
JasperMangler(java.lang.String workDir, java.lang.String docBase, java.lang.String jspFile)
           
 
Method Summary
 java.lang.String getBaseClassName()
           
 java.lang.String getClassDir()
          Returns the directory where the class is located, using the normal class loader rules.
 java.lang.String getClassFileName()
          Full path to the compiled class file ( including version )
 java.lang.String getClassName()
          Versioned class name ( without package ).
 java.lang.String getJavaFileName()
          Full path to the generated java file ( including version )
 java.lang.String getJspFile()
          Returns the jsp file, as declared by in server.xml or the context-relative path that was extension mapped to jsp
 java.lang.String getJspFilePath()
           
 java.lang.String getPackageDir()
           
 java.lang.String getPackageName()
          The package name ( "." separated ) of the generated java file
 java.lang.String getServletClassName()
          The class name ( package + class + versioning ) of the compilation result
 int getVersion()
           
 void nextVersion()
          Move to a new class name, if a changes has been detected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JasperMangler

public JasperMangler(java.lang.String workDir,
                     java.lang.String docBase,
                     java.lang.String jspFile)
Method Detail

getClassName

public java.lang.String getClassName()
Versioned class name ( without package ).

Specified by:
getClassName in interface Mangler

getJavaFileName

public java.lang.String getJavaFileName()
Full path to the generated java file ( including version )

Specified by:
getJavaFileName in interface Mangler

getPackageName

public java.lang.String getPackageName()
The package name ( "." separated ) of the generated java file

Specified by:
getPackageName in interface Mangler

getClassFileName

public java.lang.String getClassFileName()
Full path to the compiled class file ( including version )

Specified by:
getClassFileName in interface Mangler

getJspFile

public java.lang.String getJspFile()
Returns the jsp file, as declared by in server.xml or the context-relative path that was extension mapped to jsp


getClassDir

public java.lang.String getClassDir()
Returns the directory where the class is located, using the normal class loader rules.


getServletClassName

public java.lang.String getServletClassName()
The class name ( package + class + versioning ) of the compilation result


getVersion

public int getVersion()

getBaseClassName

public java.lang.String getBaseClassName()

getPackageDir

public java.lang.String getPackageDir()

getJspFilePath

public java.lang.String getJspFilePath()

nextVersion

public void nextVersion()
Move to a new class name, if a changes has been detected.



Copyright ? 2001 Apache Software Foundation. All Rights Reserved.