This project has retired. For details please refer to its Attic page.
TilesBodyTag xref
View Javadoc

1   /*
2    * $Id: TilesBodyTag.java 727708 2008-12-18 12:36:35Z apetrelli $
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   * http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  package org.apache.tiles.jsp.taglib;
22  
23  import javax.servlet.jsp.tagext.BodyTagSupport;
24  import javax.servlet.jsp.tagext.TryCatchFinally;
25  
26  /***
27   * An abstract common base class to extend for all Tiles JSP tag handlers which
28   * access body content. Defines useful life cycle extension points.
29   *
30   * @version $Rev: 727708 $ $Date: 2008-12-18 13:36:35 +0100 (gio, 18 dic 2008) $
31   * @since 2.1.1
32   */
33  public abstract class TilesBodyTag extends BodyTagSupport implements
34          TryCatchFinally {
35  
36      /***
37       * Default no-op implementation, but overrideable if needed.
38       *
39       * @param throwable The throwable object.
40       * @throws Throwable The throwable object itself, by default.
41       * @see TryCatchFinally#doCatch(Throwable)
42       */
43      public void doCatch(Throwable throwable) throws Throwable {
44          throw throwable;
45      }
46  
47      /***
48       * Called after doEndTag(). This common implementation calls reset() to
49       * release any per-invocation resources.
50       *
51       * @see TryCatchFinally#doFinally()
52       */
53      public void doFinally() {
54          reset();
55      }
56  
57      /***
58       * Release any per-invocation resources, resetting any resources or state
59       * that should be cleared between successive invocations of
60       * {@link javax.servlet.jsp.tagext.Tag#doEndTag()} and
61       * {@link javax.servlet.jsp.tagext.Tag#doStartTag()}.
62       */
63      protected void reset() {
64      }
65  
66      /***
67       * Release any per-instance resources, releasing any resources or state
68       * before this tag instance is disposed.
69       *
70       * @see javax.servlet.jsp.tagext.Tag#release()
71       */
72      @Override
73      public void release() {
74          super.release();
75          reset();
76      }
77  
78  }