public class ExpressionFunctions extends Object
Constructor and Description |
---|
ExpressionFunctions() |
Modifier and Type | Method and Description |
---|---|
static boolean |
empty(Object value)
Checks whether the given value is null or blank string
|
static boolean |
emptyList(List<?> list)
Checks to see if the list is empty.
|
static String |
getDataObjectKey(String dataObjectClassName)
Get the a primary key (valid for inquiry/maintenance view retrieval) for the dataObject by class name passed in
|
static String |
getName(Class<?> clazz)
Returns the name for the given class
|
static String |
getParam(String namespaceCode,
String componentCode,
String parameterName)
Retrieves the value of the parameter identified with the given namespace, component, and name
|
static Boolean |
getParamAsBoolean(String namespaceCode,
String componentCode,
String parameterName)
Retrieves the value of the parameter identified with the given namespace, component, and name and converts
to a Boolean
|
static Double |
getParamAsDouble(String namespaceCode,
String componentCode,
String parameterName)
Retrieves the value of the parameter identified with the given namespace, component, and name and converts
to a Double
|
static Integer |
getParamAsInteger(String namespaceCode,
String componentCode,
String parameterName)
Retrieves the value of the parameter identified with the given namespace, component, and name and converts
to a Integer
|
static <T> T |
getService(String serviceName)
Returns the service indicated by
serviceName . |
static boolean |
hasPerm(String namespaceCode,
String permissionName)
Indicates whether the current user has the permission identified by the given namespace and permission name
|
static boolean |
hasPermDtls(String namespaceCode,
String permissionName,
Map<String,String> permissionDetails,
Map<String,String> roleQualifiers)
Indicates whether the current user has the permission identified by the given namespace and permission name
and with the given details and role qualification
|
static boolean |
hasPermTmpl(String namespaceCode,
String templateName,
Map<String,String> permissionDetails,
Map<String,String> roleQualifiers)
Indicates whether the current user has the permission identified by the given namespace and template name
and with the given details and role qualification
|
static boolean |
isAssignableFrom(Class<?> assignableClass,
Class<?> objectClass)
Checks whether the given class parameter is assignable from the given object class
parameter
|
static boolean |
isProductionEnvironment()
Determines if running in a production environment.
|
static boolean |
listContains(List<?> list,
Object[] values)
Check to see if the list contains the values passed in.
|
static Long |
sequence(String sequenceName)
Gets the next available number from a sequence
|
public ExpressionFunctions()
public static boolean isAssignableFrom(Class<?> assignableClass, Class<?> objectClass)
assignableClass
- class to use for assignable toobjectClass
- class to use for assignable frompublic static boolean empty(Object value)
value
- property value to checkpublic static boolean emptyList(List<?> list)
list
- the listpublic static <T> T getService(String serviceName)
serviceName
.T
- the type of the serviceserviceName
- the name of the service to obtainserviceName
.public static boolean listContains(List<?> list, Object[] values)
In the SpringEL call values can be single item or array due to the way the EL converts values. The values can be string or numeric and should match the content type being stored in the list. If the list is String and the values passed in are not string, toString() conversion will be used. Returns true if the values are in the list and both lists are non-empty, false otherwise.
list
- the list to be evaluatedvalues
- the values to be to check for in the listpublic static String getName(Class<?> clazz)
clazz
- class object to return name forpublic static String getParam(String namespaceCode, String componentCode, String parameterName)
namespaceCode
- namespace code for the parameter to retrievecomponentCode
- component code for the parameter to retrieveparameterName
- name of the parameter to retrievepublic static Boolean getParamAsBoolean(String namespaceCode, String componentCode, String parameterName)
namespaceCode
- namespace code for the parameter to retrievecomponentCode
- component code for the parameter to retrieveparameterName
- name of the parameter to retrievepublic static Integer getParamAsInteger(String namespaceCode, String componentCode, String parameterName)
namespaceCode
- namespace code for the parameter to retrievecomponentCode
- component code for the parameter to retrieveparameterName
- name of the parameter to retrievepublic static Double getParamAsDouble(String namespaceCode, String componentCode, String parameterName)
namespaceCode
- namespace code for the parameter to retrievecomponentCode
- component code for the parameter to retrieveparameterName
- name of the parameter to retrievepublic static boolean hasPerm(String namespaceCode, String permissionName)
namespaceCode
- namespace code for the permission to checkpermissionName
- name of the permission to checkpublic static boolean hasPermDtls(String namespaceCode, String permissionName, Map<String,String> permissionDetails, Map<String,String> roleQualifiers)
namespaceCode
- namespace code for the permission to checkpermissionName
- name of the permission to checkpermissionDetails
- details for the permission checkroleQualifiers
- qualification for assigned rolespublic static boolean hasPermTmpl(String namespaceCode, String templateName, Map<String,String> permissionDetails, Map<String,String> roleQualifiers)
namespaceCode
- namespace code for the permission to checktemplateName
- name of the permission template to find permissions forpermissionDetails
- details for the permission checkroleQualifiers
- qualification for assigned rolespublic static Long sequence(String sequenceName)
sequenceName
- name of the sequence to retrieve frompublic static String getDataObjectKey(String dataObjectClassName)
dataObjectClassName
- the class name to get the key forpublic static boolean isProductionEnvironment()
Copyright © 2005–2014 The Kuali Foundation. All rights reserved.