public class ExceptionTemplate extends ContentTemplate
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
TryTemplate.createException(String),
ContentTemplate.createTry(String)m_content| Constructor and Description |
|---|
ExceptionTemplate(java.lang.String exceptionClassName)
Constructor for ExceptionTemplate.
|
| Modifier and Type | Method and Description |
|---|---|
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. |
addImport, addText, createFor, createIf, createTry, createTry, createWhile, getContent, getParent, makeInstance, makeInstance, makeInstance, setContent, setParentpublic ExceptionTemplate(java.lang.String exceptionClassName)
exceptionClassName - String, the name of the Exception to use. If this
name is fully qualified it will be added to the import statementsContentTemplate.addImport(String)public void write(java.io.PrintWriter writer,
int indent)
super.write(PrintWriter,int) to write out
the content for this method.write in interface Templatewrite in class ContentTemplatewriter - PrintWriter, an initialized PrintWriter to write this
element of the Class toindent - int, the indention for this element.
Value is multiplied by four to give the number of spaces used for indention
Template.write(java.io.PrintWriter, int)