Class Pattern


  • public class Pattern
    extends java.lang.Object
    This is a generic pattern subtitution engine. The pattern format should be:

    $[attribute set key].[attribute name]$

    For example,

    $request.requestor_email$ $ctx.user_id$

    Version:
    $Revision$, $Date$
    • Constructor Summary

      Constructors 
      Constructor Description
      Pattern​(java.lang.String s)
      Constructs a pattern object with the given string.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String substitute​(AttrSetCollection attrSetCollection)
      Subtitutes this pattern with the given attribute set.
      java.lang.String substitute​(java.lang.String key, IAttrSet attrSet)
      Subtitutes this pattern with the given attribute set.
      java.lang.String substitute2​(java.lang.String key, IAttrSet attrSet)
      Subtitutes this pattern with the given attribute set.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Pattern

        public Pattern​(java.lang.String s)
        Constructs a pattern object with the given string.
        Parameters:
        s - string with pattern (i.e. $request.requestor_email$)
    • Method Detail

      • substitute

        public java.lang.String substitute​(java.lang.String key,
                                           IAttrSet attrSet)
        Subtitutes this pattern with the given attribute set.
        Parameters:
        key - key name of the given attribute set
        attrSet - attribute set
        Returns:
        substituted string
      • substitute

        public java.lang.String substitute​(AttrSetCollection attrSetCollection)
        Subtitutes this pattern with the given attribute set.
        Parameters:
        attrSetCollection - attribute set collection
        Returns:
        substituted string
      • substitute2

        public java.lang.String substitute2​(java.lang.String key,
                                            IAttrSet attrSet)
        Subtitutes this pattern with the given attribute set. This is an extended version of the substitute() method. It takes a more flexible pattern format that could have non-token ($...$) format. e.g. $request.screenname$@redhat.com where "@redhat.com" is not in token pattern format, and will be literally put in place. e.g. TomRiddle@redhat.com
        Parameters:
        key - key name of the given attribute set
        attrSet - attribute set
        Returns:
        substituted string