public class TryTemplate extends ContentTemplate
m_content| Constructor and Description |
|---|
TryTemplate() |
TryTemplate(java.lang.Class exceptionClass)
Constructor for TryTemplate.
|
TryTemplate(java.lang.String exceptionClassName) |
TryTemplate(java.lang.String exceptionClassName,
java.lang.String withResource)
Constructor for TryTemplate.
|
| Modifier and Type | Method and Description |
|---|---|
ExceptionTemplate |
createException(java.lang.String exceptionClassName)
create a new Exception for this Try statement.
|
BlockTemplate |
createFinally()
create a finally block for this Exception
|
ExceptionTemplate |
getDefaultException()
get the Exception this Try statement was created with
|
java.util.List |
getExceptions() |
void |
write(java.io.PrintWriter writer,
int indent)
write the TryStatement to the PrintWriter.
|
addImport, addText, createFor, createIf, createTry, createTry, createWhile, getContent, getParent, makeInstance, makeInstance, makeInstance, setContent, setParentpublic TryTemplate()
public TryTemplate(java.lang.Class exceptionClass)
exceptionClass - Class, the class for the Exception this
try should catch. You can add more Exceptions by using createException(String)createException(java.lang.String)public TryTemplate(java.lang.String exceptionClassName)
public TryTemplate(java.lang.String exceptionClassName,
java.lang.String withResource)
exceptionClassName - String, a String representing the complete class name, including package of the
Exception this try should catch. You can add more Exceptions by using createException(String)createException(java.lang.String)public void write(java.io.PrintWriter writer,
int indent)
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(PrintWriter, int)public ExceptionTemplate getDefaultException()
public ExceptionTemplate createException(java.lang.String exceptionClassName)
exceptionClassName - String, the fully qualified class name of this Exceptionpublic BlockTemplate createFinally()
finally blockpublic java.util.List getExceptions()