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

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