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  
20  package org.apache.myfaces.tobago.internal.util;
21  
22  import org.slf4j.Logger;
23  import org.slf4j.LoggerFactory;
24  
25  import java.lang.invoke.MethodHandles;
26  
27  
28  public final class Deprecation {
29  
30    // to prevent instantiation
31    private Deprecation() {
32    }
33  
34    /**
35     * This Logger object should help to detect the usage of deprecated code.
36     * The main reason for this class is the lack of a "deprecated concept"
37     * for tag libraries. Thought the designer of a Tobago page cannot see
38     * in his IDE that a tag or attribute is deprecated.
39     * <p>
40     * The Tobago Java code will log into this Logger object, with
41     * <dl>
42     *   <dt><code>error</code></dt>
43     *   <dd>when the code is deprecated with a loss of function, or</dd>
44     *   <dt><code>warn</code></dt>
45     *   <dd>when the code is deprecated, but still works.</dd>
46     * </dl>
47     * <p>
48     * This Logger category can be switched off, in production environment without
49     * affecting the normal logging category.
50     */
51    public static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
52  
53  }