001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.model;
016    
017    import com.liferay.portal.kernel.util.Tuple;
018    import com.liferay.portal.kernel.xml.Element;
019    
020    import java.util.List;
021    import java.util.Map;
022    
023    /**
024     * @author Brian Wing Shun Chan
025     */
026    public class ModelHintsUtil {
027    
028            public static Map<String, String> getDefaultHints(String model) {
029                    return getModelHints().getDefaultHints(model);
030            }
031    
032            public static Element getFieldsEl(String model, String field) {
033                    return getModelHints().getFieldsEl(model, field);
034            }
035    
036            public static Map<String, String> getHints(String model, String field) {
037                    return getModelHints().getHints(model, field);
038            }
039    
040            public static ModelHints getModelHints() {
041                    return _modelHints;
042            }
043    
044            public static List<String> getModels() {
045                    return getModelHints().getModels();
046            }
047    
048            public static Tuple getSanitizeTuple(String model, String field) {
049                    return getModelHints().getSanitizeTuple(model, field);
050            }
051    
052            public static List<Tuple> getSanitizeTuples(String model) {
053                    return getModelHints().getSanitizeTuples(model);
054            }
055    
056            public static String getType(String model, String field) {
057                    return getModelHints().getType(model, field);
058            }
059    
060            public static boolean isLocalized(String model, String field) {
061                    return getModelHints().isLocalized(model, field);
062            }
063    
064            public static void read(ClassLoader classLoader, String source)
065                    throws Exception {
066    
067                    getModelHints().read(classLoader, source);
068            }
069    
070            public static String trimString(String model, String field, String value) {
071                    return getModelHints().trimString(model, field, value);
072            }
073    
074            public void setModelHints(ModelHints modelHints) {
075                    _modelHints = modelHints;
076            }
077    
078            private static ModelHints _modelHints;
079    
080    }