|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface that can be implemented by writers returned from
TemplateTransformModel.getWriter(Writer, Map)
. The methods on this
interfaces are callbacks that will be called by the template engine and that
give the writer a chance to better control the evaluation of the transform
body. The writer can instruct the engine to skip or to repeat body
evaluation, and gets notified about exceptions that are thrown during the
body evaluation.
Field Summary | |
static int |
END_EVALUATION
Constant returned from afterBody() that tells the
template engine to end the transform and close the writer. |
static int |
EVALUATE_BODY
Constant returned from onStart() that tells the
template engine to evaluate the body. |
static int |
REPEAT_EVALUATION
Constant returned from afterBody() that tells the
template engine to repeat transform body evaluation and feed
it again to the transform. |
static int |
SKIP_BODY
Constant returned from onStart() that tells the
template engine to skip evaluation of the body. |
Method Summary | |
int |
afterBody()
Called after the body has been evaluated. |
void |
onError(java.lang.Throwable t)
Called if any exception occurs during the transform between the TemplateTransformModel.getWriter(Writer, Map) call and the
Writer.close() call. |
int |
onStart()
Called before the body is evaluated for the first time. |
Field Detail |
public static final int REPEAT_EVALUATION
afterBody()
that tells the
template engine to repeat transform body evaluation and feed
it again to the transform.
public static final int END_EVALUATION
afterBody()
that tells the
template engine to end the transform and close the writer.
public static final int SKIP_BODY
onStart()
that tells the
template engine to skip evaluation of the body.
public static final int EVALUATE_BODY
onStart()
that tells the
template engine to evaluate the body.
Method Detail |
public int onStart() throws TemplateModelException, java.io.IOException
Writer.close()
is called next and processing ends.TemplateModelException
java.io.IOException
public int afterBody() throws TemplateModelException, java.io.IOException
TemplateModelException
java.io.IOException
public void onError(java.lang.Throwable t) throws java.lang.Throwable
TemplateTransformModel.getWriter(Writer, Map)
call and the
Writer.close()
call.
t
- the throwable that represents the exception. It can be any
non-checked throwable, as well as TemplateException
and
IOException
.
it
- is recommended that the methods rethrow the received
throwable. If the method wants to throw another throwable, it should
either throw a non-checked throwable, or an instance of
TemplateException
and IOException
. Throwing any
other checked exception will cause the engine to rethrow it as
a UndeclaredThrowableException
.
java.lang.Throwable
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |