org.kuali.rice.krad.uif.util
Class ExpressionFunctions

java.lang.Object
  extended by org.kuali.rice.krad.uif.util.ExpressionFunctions

public class ExpressionFunctions
extends Object

Defines functions that can be used in el expressions within the UIF dictionary files

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
ExpressionFunctions()
           
 
Method Summary
static boolean empty(Object value)
          Checks whether the given value is null or blank string
static String getName(Class<?> clazz)
          Returns the name for the given class
static String getParm(String namespaceCode, String componentCode, String parameterName)
          Retrieves the value of the parameter identified with the given namespace, component, and name
static Boolean getParmInd(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 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionFunctions

public ExpressionFunctions()
Method Detail

isAssignableFrom

public static boolean isAssignableFrom(Class<?> assignableClass,
                                       Class<?> objectClass)
Checks whether the given class parameter is assignable from the given object class parameter

Parameters:
assignableClass - - class to use for assignable to
objectClass - - class to use for assignable from
Returns:
boolean true if the object class is of type assignable class, false if not

empty

public static boolean empty(Object value)
Checks whether the given value is null or blank string

Parameters:
value - - property value to check
Returns:
boolean true if value is null or blank, false if not

getName

public static String getName(Class<?> clazz)
Returns the name for the given class

Parameters:
clazz - - class object to return name for
Returns:
String class name or empty string if class is null

getParm

public static String getParm(String namespaceCode,
                             String componentCode,
                             String parameterName)
Retrieves the value of the parameter identified with the given namespace, component, and name

Parameters:
namespaceCode - - namespace code for the parameter to retrieve
componentCode - - component code for the parameter to retrieve
parameterName - - name of the parameter to retrieve
Returns:
String value of parameter as a string or null if parameter does not exist

getParmInd

public static Boolean getParmInd(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 retrieve
componentCode - - component code for the parameter to retrieve
parameterName - - name of the parameter to retrieve
Returns:
Boolean value of parameter as a boolean or null if parameter does not exist

hasPerm

public static boolean hasPerm(String namespaceCode,
                              String permissionName)
Indicates whether the current user has the permission identified by the given namespace and permission name

Parameters:
namespaceCode - - namespace code for the permission to check
permissionName - - name of the permission to check
Returns:
boolean 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 check
permissionName - - name of the permission to check
permissionDetails - - details for the permission check
roleQualifiers - - qualification for assigned roles
Returns:
boolean 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 check
templateName - - name of the permission template to find permissions for
permissionDetails - - details for the permission check
roleQualifiers - - qualification for assigned roles
Returns:
boolean true if the current user has a permission with the given template, false if not or the permission does not exist


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.