View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.myfaces.extensions.validator.core.interceptor;
20  
21  import org.apache.myfaces.extensions.validator.internal.UsageCategory;
22  import org.apache.myfaces.extensions.validator.internal.UsageInformation;
23  import org.apache.myfaces.extensions.validator.core.renderkit.exception.SkipRendererDelegationException;
24  import org.apache.myfaces.extensions.validator.core.renderkit.exception.SkipBeforeInterceptorsException;
25  import org.apache.myfaces.extensions.validator.core.renderkit.exception.SkipAfterInterceptorsException;
26  
27  import javax.faces.context.FacesContext;
28  import javax.faces.component.UIComponent;
29  import javax.faces.convert.ConverterException;
30  import javax.faces.render.Renderer;
31  import java.io.IOException;
32  import java.util.logging.Logger;
33  
34  /**
35   * Empty base implementation which allows concrete implementations to override just the needed methods.
36   *
37   * @since 1.x.1
38   */
39  @UsageInformation(UsageCategory.INTERNAL)
40  public abstract class AbstractRendererInterceptor implements RendererInterceptor
41  {
42      protected final Logger logger = Logger.getLogger(getClass().getName());
43  
44      protected AbstractRendererInterceptor()
45      {
46              logger.fine(getClass().getName() + " instantiated");
47      }
48  
49      public final String getInterceptorId()
50      {
51          return getClass().getName();
52      }
53  
54      /**
55       * {@inheritDoc}
56       */
57      public Object getReturnValueOnSkipRendererDelegationException(
58          SkipRendererDelegationException skipRendererDelegationException, Object currentReturnValue)
59      {
60          return currentReturnValue;
61      }
62  
63      /*
64      * before
65      */
66      /**
67       * {@inheritDoc}
68       */
69      public void beforeDecode(FacesContext facesContext, UIComponent uiComponent, Renderer wrapped)
70          throws SkipBeforeInterceptorsException, SkipRendererDelegationException
71      {
72      }
73  
74      /**
75       * {@inheritDoc}
76       */
77      public void beforeEncodeBegin(FacesContext facesContext, UIComponent uiComponent, Renderer wrapped)
78          throws IOException, SkipBeforeInterceptorsException, SkipRendererDelegationException
79      {
80      }
81  
82      /**
83       * {@inheritDoc}
84       */
85      public void beforeEncodeChildren(FacesContext facesContext, UIComponent uiComponent, Renderer wrapped)
86          throws IOException, SkipBeforeInterceptorsException, SkipRendererDelegationException
87      {
88      }
89  
90      /**
91       * {@inheritDoc}
92       */
93      public void beforeEncodeEnd(FacesContext facesContext, UIComponent uiComponent, Renderer wrapped)
94          throws IOException, SkipBeforeInterceptorsException, SkipRendererDelegationException
95      {
96      }
97  
98      /**
99       * {@inheritDoc}
100      */
101     public void beforeGetConvertedValue(FacesContext facesContext, UIComponent uiComponent, Object o, Renderer wrapped)
102         throws ConverterException, SkipBeforeInterceptorsException, SkipRendererDelegationException
103     {
104     }
105 
106     /*
107      * after
108      */
109     /**
110      * {@inheritDoc}
111      */
112     public void afterDecode(FacesContext facesContext, UIComponent uiComponent, Renderer wrapped)
113         throws SkipAfterInterceptorsException
114     {
115     }
116 
117     /**
118      * {@inheritDoc}
119      */
120     public void afterEncodeBegin(FacesContext facesContext, UIComponent uiComponent, Renderer wrapped)
121         throws IOException, SkipAfterInterceptorsException
122     {
123     }
124 
125     /**
126      * {@inheritDoc}
127      */
128     public void afterEncodeChildren(FacesContext facesContext, UIComponent uiComponent, Renderer wrapped)
129         throws IOException, SkipAfterInterceptorsException
130     {
131     }
132 
133     /**
134      * {@inheritDoc}
135      */
136     public void afterEncodeEnd(FacesContext facesContext, UIComponent uiComponent, Renderer wrapped)
137         throws IOException, SkipAfterInterceptorsException
138     {
139     }
140 
141     /**
142      * {@inheritDoc}
143      */
144     public void afterGetConvertedValue(FacesContext facesContext, UIComponent uiComponent, Object o, Renderer wrapped)
145         throws ConverterException, SkipAfterInterceptorsException
146     {
147     }
148 }