org.brains2b.typewriter
Class ExceptionTemplate

java.lang.Object
  extended byorg.brains2b.typewriter.ContentTemplate
      extended byorg.brains2b.typewriter.ExceptionTemplate
All Implemented Interfaces:
Template

public class ExceptionTemplate
extends ContentTemplate

Template for creating a "} catch ([Exception] [ex]) {" statement in a template

This Template will make an variable name out of the Exception itself by taking all capital letters in an exception name and putting them one after another and finally adding ex to it. So MalformedUrlException becomes muex;

If Exception itself is used ex will be the variable name, if Throwable is used t will be the variable name

Version:
0.11 22-08-2004
Author:
dennis@brains2b.nl
See Also:
TryTemplate.createException(String), ContentTemplate.createTry(String)

Field Summary
 
Fields inherited from class org.brains2b.typewriter.ContentTemplate
m_content
 
Constructor Summary
ExceptionTemplate(java.lang.String exceptionClassName)
          Constructor for ExceptionTemplate.
 
Method Summary
 void write(java.io.PrintWriter writer, int indent)
          overwrite this to implement a content types specific needs and call super.write(PrintWriter,int) to write out the content for this method.
 
Methods inherited from class org.brains2b.typewriter.ContentTemplate
addImport, addText, createFor, createIf, createTry, createWhile, getContent, getParent, makeInstance, makeInstance, makeInstance, setContent, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionTemplate

public ExceptionTemplate(java.lang.String exceptionClassName)
Constructor for ExceptionTemplate.

Parameters:
exceptionClassName - String, the name of the Exception to use. If this name is fully qualified it will be added to the import statements
See Also:
ContentTemplate.addImport(String)
Method Detail

write

public void write(java.io.PrintWriter writer,
                  int indent)
overwrite this to implement a content types specific needs and call super.write(PrintWriter,int) to write out the content for this method.

Specified by:
write in interface Template
Overrides:
write in class ContentTemplate
See Also:
Template.write(java.io.PrintWriter, int)