1   /**
2    * Copyright (c) 2000-2010 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   *
12   *
13   */
14  
15  package com.liferay.portal.model;
16  
17  import com.liferay.portal.kernel.util.Tuple;
18  import com.liferay.portal.kernel.xml.Element;
19  
20  import java.util.List;
21  import java.util.Map;
22  
23  /**
24   * <a href="ModelHintsUtil.java.html"><b><i>View Source</i></b></a>
25   *
26   * @author Brian Wing Shun Chan
27   */
28  public class ModelHintsUtil {
29  
30      public static Map<String, String> getDefaultHints(String model) {
31          return getModelHints().getDefaultHints(model);
32      }
33  
34      public static Element getFieldsEl(String model, String field) {
35          return getModelHints().getFieldsEl(model, field);
36      }
37  
38      public static Map<String, String> getHints(String model, String field) {
39          return getModelHints().getHints(model, field);
40      }
41  
42      public static ModelHints getModelHints() {
43          return _modelHints;
44      }
45  
46      public static List<String> getModels() {
47          return getModelHints().getModels();
48      }
49  
50      public static Tuple getSanitizeTuple(String model, String field) {
51          return getModelHints().getSanitizeTuple(model, field);
52      }
53  
54      public static List<Tuple> getSanitizeTuples(String model) {
55          return getModelHints().getSanitizeTuples(model);
56      }
57  
58      public static String getType(String model, String field) {
59          return getModelHints().getType(model, field);
60      }
61  
62      public static boolean isLocalized(String model, String field) {
63          return getModelHints().isLocalized(model, field);
64      }
65  
66      public static void read(ClassLoader classLoader, String source)
67          throws Exception {
68  
69          getModelHints().read(classLoader, source);
70      }
71  
72      public static String trimString(String model, String field, String value) {
73          return getModelHints().trimString(model, field, value);
74      }
75  
76      public void setModelHints(ModelHints modelHints) {
77          _modelHints = modelHints;
78      }
79  
80      private static ModelHints _modelHints;
81  
82  }