Class RegularExpression

java.lang.Object
com.aquima.interactions.framework.mask.impl.AbstractMask
com.aquima.interactions.framework.mask.impl.RegularExpression
All Implemented Interfaces:
IMask

public class RegularExpression extends AbstractMask
Mask which replaces each substring of a string value that matches a given regular expression with the given replacement.

Example: StringValue("571518833") -> 57.15.18.833

Required parameters:
  • regexp-search: regular expression used for search
  • replace: string to replace with
Optional parameters:
  • toupper: true/false Apply to upper case BEFORE regular expression is evaluated (default=false).
  • tolower: true/false Apply to lower case BEFORE regular expression is evaluated (default=false).
Since:
6.0
Author:
Jon van Leuven
  • Constructor Details

    • RegularExpression

      public RegularExpression()
  • Method Details

    • applySingleValue

      protected String applySingleValue(ISingleValue singleValue, IMaskContext context, ILanguage language) throws Exception
      Description copied from class: AbstractMask
      This method is called when this mask is applied.
      Specified by:
      applySingleValue in class AbstractMask
      Parameters:
      singleValue - The value, never null and never unknown.
      context - Mask context
      language - the language
      Returns:
      The applied mask result.
      Throws:
      Exception - When something went wrong.
    • getValidDataTypes

      protected DataType[] getValidDataTypes()
      Description copied from class: AbstractMask
      Should return the datatypes for which this mask can be applied.
      Specified by:
      getValidDataTypes in class AbstractMask
      Returns:
      Array of datatypes.