View Javadoc

1   /*
2    * $Id: ClassUtil.java 708904 2008-10-29 13:37:02Z 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.util;
22  
23  import org.apache.tiles.TilesException;
24  
25  
26  /***
27   * Utilities to work with dynamic class loading and instantiation.
28   *
29   * @version $Rev: 708904 $ $Date: 2008-10-29 14:37:02 +0100 (Wed, 29 Oct 2008) $
30   * @deprecated Use {@link org.apache.tiles.reflect.ClassUtil}.
31   */
32  @Deprecated
33  public final class ClassUtil {
34  
35      /***
36       * Constructor, private to avoid instantiation.
37       */
38      private ClassUtil() {
39      }
40  
41      /***
42       * Returns an instance of the given class name, by calling the default
43       * constructor.
44       *
45       * @param className The class name to load and to instantiate.
46       * @return The new instance of the class name.
47       * @throws TilesException If something goes wrong during instantiation.
48       * @deprecated Use
49       * {@link org.apache.tiles.reflect.ClassUtil#instantiate(String)}.
50       */
51      @Deprecated
52      public static Object instantiate(String className) throws TilesException {
53          return org.apache.tiles.reflect.ClassUtil.instantiate(className);
54      }
55  
56      /***
57       * Returns an instance of the given class name, by calling the default
58       * constructor.
59       *
60       * @param className The class name to load and to instantiate.
61       * @param returnNull If <code>true</code>, if the class is not found it
62       * returns <code>true</code>, otherwise it throws a
63       * <code>TilesException</code>.
64       * @return The new instance of the class name.
65       * @throws TilesException If something goes wrong during instantiation.
66       * @deprecated Use
67       * {@link org.apache.tiles.reflect.ClassUtil#instantiate(String, boolean)}.
68       */
69      @Deprecated
70      public static Object instantiate(String className, boolean returnNull)
71          throws TilesException {
72          return org.apache.tiles.reflect.ClassUtil.instantiate(className,
73                  returnNull);
74      }
75  
76  }