com.liferay.portal.kernel.model.ModelHintsUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.portal.kernel Show documentation
Show all versions of com.liferay.portal.kernel Show documentation
Contains interfaces for the portal services. Interfaces are only loaded by the global class loader and are shared by all plugins.
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.portal.kernel.model;
import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
import com.liferay.portal.kernel.util.Tuple;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
/**
* @author Brian Wing Shun Chan
*/
public class ModelHintsUtil {
public static String buildCustomValidatorName(String validatorName) {
return getModelHints().buildCustomValidatorName(validatorName);
}
public static Map getDefaultHints(String model) {
return getModelHints().getDefaultHints(model);
}
public static Object getFieldsElement(String model, String field) {
return getModelHints().getFieldsElement(model, field);
}
public static Map getHints(String model, String field) {
return getModelHints().getHints(model, field);
}
public static int getMaxLength(String model, String field) {
return getModelHints().getMaxLength(model, field);
}
public static ModelHints getModelHints() {
PortalRuntimePermission.checkGetBeanProperty(ModelHintsUtil.class);
return _modelHints;
}
public static List getModels() {
return getModelHints().getModels();
}
public static Tuple getSanitizeTuple(String model, String field) {
return getModelHints().getSanitizeTuple(model, field);
}
public static List getSanitizeTuples(String model) {
return getModelHints().getSanitizeTuples(model);
}
public static String getType(String model, String field) {
return getModelHints().getType(model, field);
}
public static List getValidators(String model, String field) {
return getModelHints().getValidators(model, field);
}
public static String getValue(
String model, String field, String name, String defaultValue) {
return getModelHints().getValue(model, field, name, defaultValue);
}
public static boolean hasField(String model, String field) {
return getModelHints().hasField(model, field);
}
public static boolean isCustomValidator(String validatorName) {
return getModelHints().isCustomValidator(validatorName);
}
public static boolean isLocalized(String model, String field) {
return getModelHints().isLocalized(model, field);
}
public static void read(ClassLoader classLoader, InputStream inputStream)
throws Exception {
getModelHints().read(classLoader, inputStream);
}
public static void read(ClassLoader classLoader, String source)
throws Exception {
getModelHints().read(classLoader, source);
}
public static String trimString(String model, String field, String value) {
return getModelHints().trimString(model, field, value);
}
public void setModelHints(ModelHints modelHints) {
PortalRuntimePermission.checkSetBeanProperty(getClass());
_modelHints = modelHints;
}
private static ModelHints _modelHints;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy