1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.kernel.bean;
21  
22  /**
23   * <a href="BeanPropertiesUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class BeanPropertiesUtil {
29  
30      public static BeanProperties getBeanProperties() {
31          return _beanProperties;
32      }
33  
34      public static boolean getBoolean(Object bean, String param) {
35          return getBeanProperties().getBoolean(bean, param);
36      }
37  
38      public static boolean getBoolean(
39          Object bean, String param, boolean defaultValue) {
40  
41          return getBeanProperties().getBoolean(bean, param, defaultValue);
42      }
43  
44      public static double getDouble(Object bean, String param) {
45          return getBeanProperties().getDouble(bean, param);
46      }
47  
48      public static double getDouble(
49          Object bean, String param, double defaultValue) {
50  
51          return getBeanProperties().getDouble(bean, param, defaultValue);
52      }
53  
54      public static int getInteger(Object bean, String param) {
55          return getBeanProperties().getInteger(bean, param);
56      }
57  
58      public static int getInteger(
59          Object bean, String param, int defaultValue) {
60  
61          return getBeanProperties().getInteger(bean, param, defaultValue);
62      }
63  
64      public static long getLong(Object bean, String param) {
65          return getBeanProperties().getLong(bean, param);
66      }
67  
68      public static long getLong(
69          Object bean, String param, long defaultValue) {
70  
71          return getBeanProperties().getLong(bean, param, defaultValue);
72      }
73  
74      public static Object getObject(Object bean, String param) {
75          return getBeanProperties().getObject(bean, param);
76      }
77  
78      public static Object getObject(
79          Object bean, String param, Object defaultValue) {
80  
81          return getBeanProperties().getObject(bean, param, defaultValue);
82      }
83  
84      public static String getString(Object bean, String param) {
85          return getBeanProperties().getString(bean, param);
86      }
87  
88      public static String getString(
89          Object bean, String param, String defaultValue) {
90  
91          return getBeanProperties().getString(bean, param, defaultValue);
92      }
93  
94      public void setBeanProperties(BeanProperties beanProperties) {
95          _beanProperties = beanProperties;
96      }
97  
98      private static BeanProperties _beanProperties;
99  
100 }