Class CAFFunctions

java.lang.Object
com.webmethods.caf.faces.el.CAFFunctions

public class CAFFunctions extends Object
CAF functions exposed as expression-language functions under the "caf" namespace.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Standard prefix for CAF functions ("caf").
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    cid(String id)
    Creates client-side control id from server-side id.
    static String
    Creates selector safe client-side control id from server-side id.
    static Boolean
    Validates that the specified value is a boolean.
    static String
    Escapes the specified string to be safe for use in html or html-attribute content.
    static String
    Escapes the specified string to be safe for use in a javascript string.
    static Number
    Validates that the specified value is a number.
    static String
    Validates that the specified url starts with a safe url scheme.
    static String
    Escapes the specified string to be safe for use in a url-parameter name or value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • CAFFunctions

      public CAFFunctions()
  • Method Details

    • cid

      public static String cid(String id)
      Creates client-side control id from server-side id.
      Parameters:
      id - Server-side id.
      Returns:
      Client-side id.
    • scid

      public static String scid(String s)
      Creates selector safe client-side control id from server-side id. The colon ':' character is reserved for the CSS/JS selector so this function will escape all of the colon characters by placing two backslashes in front of them.
      Parameters:
      id - Server-side id.
      Returns:
      Client-side id.
    • xh

      public static String xh(String s)
      Escapes the specified string to be safe for use in html or html-attribute content.
      Parameters:
      s - String to escape.
      Returns:
      Escaped string.
    • xu

      public static String xu(String s)
      Escapes the specified string to be safe for use in a url-parameter name or value.
      Parameters:
      s - String to escape.
      Returns:
      Escaped string.
    • xs

      public static String xs(String s)
      Validates that the specified url starts with a safe url scheme.
      Parameters:
      s - URL to validate.
      Returns:
      URL if its scheme is safe; empty-string ("") if its scheme is not safe.
    • xj

      public static String xj(String s)
      Escapes the specified string to be safe for use in a javascript string.
      Parameters:
      s - String to escape.
      Returns:
      Escaped string.
    • xb

      public static Boolean xb(Object o)
      Validates that the specified value is a boolean.
      Parameters:
      o - Value to validate.
      Returns:
      Boolean true if the value is true; false if the value is false or not a boolean value.
    • xn

      public static Number xn(Object o)
      Validates that the specified value is a number.
      Parameters:
      o - Value to validate.
      Returns:
      The number if the value is a number; 0 if the value is not a number.