Package org.kuali.rice.krad.uif.util
Class ExpressionFunctions
java.lang.Object
org.kuali.rice.krad.uif.util.ExpressionFunctions
Defines functions that can be used in el expressions within
the UIF dictionary files
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks whether the given value is null or blank stringstatic booleanChecks to see if the list is empty.static StringgetDataObjectKey(String dataObjectClassName) Get the a primary key (valid for inquiry/maintenance view retrieval) for the dataObject by class name passed instatic StringReturns the name for the given classstatic StringRetrieves the value of the parameter identified with the given namespace, component, and namestatic BooleangetParamAsBoolean(String namespaceCode, String componentCode, String parameterName) Retrieves the value of the parameter identified with the given namespace, component, and name and converts to a Booleanstatic DoublegetParamAsDouble(String namespaceCode, String componentCode, String parameterName) Retrieves the value of the parameter identified with the given namespace, component, and name and converts to a Doublestatic IntegergetParamAsInteger(String namespaceCode, String componentCode, String parameterName) Retrieves the value of the parameter identified with the given namespace, component, and name and converts to a Integerstatic <T> TgetService(String serviceName) Returns the service indicated byserviceName.static booleanIndicates whether the current user has the permission identified by the given namespace and permission namestatic booleanhasPermDtls(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 qualificationstatic booleanhasPermTmpl(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 qualificationstatic booleanisAssignableFrom(Class<?> assignableClass, Class<?> objectClass) Checks whether the given class parameter is assignable from the given object class parameterstatic booleanDetermines if running in a production environment.static booleanlistContains(List<?> list, Object[] values) Check to see if the list contains the values passed in.static LongGets the next available number from a sequence
-
Constructor Details
-
ExpressionFunctions
public ExpressionFunctions()
-
-
Method Details
-
isAssignableFrom
Checks whether the given class parameter is assignable from the given object class parameter- Parameters:
assignableClass- class to use for assignable toobjectClass- class to use for assignable from- Returns:
- true if the object class is of type assignable class, false if not
-
empty
Checks whether the given value is null or blank string- Parameters:
value- property value to check- Returns:
- true if value is null or blank, false if not
-
emptyList
Checks to see if the list is empty. Throws a RuntimeException if list is not a List.- Parameters:
list- the list- Returns:
- true if the list is null or empty, false otherwise
-
getService
Returns the service indicated byserviceName.- Type Parameters:
T- the type of the service- Parameters:
serviceName- the name of the service to obtain- Returns:
- the service indicated by
serviceName.
-
listContains
Check to see if the list contains the values passed in.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.
- Parameters:
list- the list to be evaluatedvalues- the values to be to check for in the list- Returns:
- true if all values exist in the list and both values and list are non-null/not-empty, false otherwise
-
getName
Returns the name for the given class- Parameters:
clazz- class object to return name for- Returns:
- class name or empty string if class is null
-
getParam
Retrieves the value of the parameter identified with the given namespace, component, and name- Parameters:
namespaceCode- namespace code for the parameter to retrievecomponentCode- component code for the parameter to retrieveparameterName- name of the parameter to retrieve- Returns:
- String value of parameter as a string or null if parameter does not exist
-
getParamAsBoolean
public 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- Parameters:
namespaceCode- namespace code for the parameter to retrievecomponentCode- component code for the parameter to retrieveparameterName- name of the parameter to retrieve- Returns:
- Boolean value of parameter as a boolean or null if parameter does not exist
-
getParamAsInteger
public 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- Parameters:
namespaceCode- namespace code for the parameter to retrievecomponentCode- component code for the parameter to retrieveparameterName- name of the parameter to retrieve- Returns:
- Boolean value of parameter as a Integer or null if parameter does not exist
-
getParamAsDouble
public 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- Parameters:
namespaceCode- namespace code for the parameter to retrievecomponentCode- component code for the parameter to retrieveparameterName- name of the parameter to retrieve- Returns:
- Boolean value of parameter as a Double or null if parameter does not exist
-
hasPerm
Indicates whether the current user has the permission identified by the given namespace and permission name- Parameters:
namespaceCode- namespace code for the permission to checkpermissionName- name of the permission to check- Returns:
- true if the current user has the permission, false if not or the permission does not exist
-
hasPermDtls
public 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- Parameters:
namespaceCode- namespace code for the permission to checkpermissionName- name of the permission to checkpermissionDetails- details for the permission checkroleQualifiers- qualification for assigned roles- Returns:
- true if the current user has the permission, false if not or the permission does not exist
-
hasPermTmpl
public 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- Parameters:
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 roles- Returns:
- true if the current user has a permission with the given template, false if not or the permission does not exist
-
sequence
Gets the next available number from a sequence- Parameters:
sequenceName- name of the sequence to retrieve from- Returns:
- next sequence value
-
getDataObjectKey
Get the a primary key (valid for inquiry/maintenance view retrieval) for the dataObject by class name passed in- Parameters:
dataObjectClassName- the class name to get the key for- Returns:
- a key valid for use as a request parameter for retrieving an inquiry or maintenance doc
-
isProductionEnvironment
public static boolean isProductionEnvironment()Determines if running in a production environment.- Returns:
- true if running in a production environment
-