org.apache.taglibs.mailer2
Class JSP20to12

java.lang.Object
  extended byorg.apache.taglibs.mailer2.JSP20to12

public class JSP20to12
extends Object

Class JSP20to12 will convert JSP 2.0 tags to a JSP 1.1.

This programme will:


Constructor Summary
JSP20to12()
           
 
Method Summary
 boolean checkInterface(Class clazz, String interfaceName)
          Check whether a class or one of its superclasses implements an interface.
 String createBodyCode(Class tagClass)
          Creates Java code to evaluate EL in BodyContent.
 String createELCode(String name, Class type)
          Creates the Java code to evaluate an EL expression.
 String createSetterCode(String name)
          Creates the Java code for a setter method.
 String getChildValue(Node parent, String nodeName)
          Returns the text nodeValue() of a child element.
 Method getSetter(Class tagClass, String name)
          Gets the setter method in a class.
static void main(String[] args)
          Main entry point.
 void process(String[] args)
          Process the command line arguments and run the conversion.
 void processJAR(String name)
          Process a JAR file from the command line.
 void processTag(Node tag)
          Process a <tag> within a TLD.
 void processTLD(String name, InputStream in)
          Process a single TLD within a JAR.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSP20to12

public JSP20to12()
Method Detail

main

public static void main(String[] args)
Main entry point.

Parameters:
args - Command line arguments

process

public void process(String[] args)
Process the command line arguments and run the conversion.

Parameters:
args - Command line arguments

processJAR

public void processJAR(String name)
                throws IOException
Process a JAR file from the command line.

Parameters:
name - The name of the JAR file
Throws:
IOException - Upon error

processTLD

public void processTLD(String name,
                       InputStream in)
                throws IOException
Process a single TLD within a JAR.

Parameters:
name - The name of the TLD
in - The inputstream to read the TLD from
Throws:
IOException - Upon error

processTag

public void processTag(Node tag)
Process a <tag> within a TLD. Writes out a new class file.

Parameters:
tag - The Node in the DOM document that represents this tag

getSetter

public Method getSetter(Class tagClass,
                        String name)
Gets the setter method in a class.

Parameters:
tagClass - The tag class
name - The name of the setter method, e.g. "setName"
Returns:
The setter method or null if none found

createSetterCode

public String createSetterCode(String name)
Creates the Java code for a setter method.

Parameters:
name - The name of the attribute, e.g. "name"
Returns:
Java code

createELCode

public String createELCode(String name,
                           Class type)
Creates the Java code to evaluate an EL expression.

Parameters:
name - The name of the attribute, e.g. "name"
type - The type of the attribute, e.g. java.lang.String.class
Returns:
Java code

createBodyCode

public String createBodyCode(Class tagClass)
Creates Java code to evaluate EL in BodyContent.

Parameters:
tagClass - The tag class
Returns:
Java code

checkInterface

public boolean checkInterface(Class clazz,
                              String interfaceName)
Check whether a class or one of its superclasses implements an interface.

Parameters:
clazz - The class to check
interfaceName - The name of the interface to check
Returns:
true if the interface is implemented, false otherwise

getChildValue

public String getChildValue(Node parent,
                            String nodeName)
Returns the text nodeValue() of a child element.

Parameters:
parent - The parent node
nodeName - The name of the child element
Returns:
The value of the child element, or null if none found


Copyright © 2004 Apache Software Foundation, http://jakarta.apache.org/taglibs