001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.model;
016    
017    import com.liferay.portal.kernel.util.Tuple;
018    
019    import java.io.InputStream;
020    
021    import java.util.List;
022    import java.util.Map;
023    
024    /**
025     * @author Brian Wing Shun Chan
026     */
027    public interface ModelHints {
028    
029            public String buildCustomValidatorName(String validatorName);
030    
031            public Map<String, String> getDefaultHints(String model);
032    
033            public Object getFieldsElement(String model, String field);
034    
035            public Map<String, String> getHints(String model, String field);
036    
037            public int getMaxLength(String model, String field);
038    
039            public List<String> getModels();
040    
041            public Tuple getSanitizeTuple(String model, String field);
042    
043            public List<Tuple> getSanitizeTuples(String model);
044    
045            public String getType(String model, String field);
046    
047            public List<Tuple> getValidators(String model, String field);
048    
049            public String getValue(
050                    String model, String field, String name, String defaultValue);
051    
052            public boolean hasField(String model, String field);
053    
054            public boolean isCustomValidator(String validatorName);
055    
056            public boolean isLocalized(String model, String field);
057    
058            public void read(ClassLoader classLoader, InputStream inputStream)
059                    throws Exception;
060    
061            public void read(ClassLoader classLoader, String source) throws Exception;
062    
063            public String trimString(String model, String field, String value);
064    
065    }