Class Pattern

java.lang.Object
com.netscape.certsrv.pattern.Pattern

public class Pattern extends 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 Details

    • Pattern

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

    • substitute

      public String substitute(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 String substitute(AttrSetCollection attrSetCollection)
      Subtitutes this pattern with the given attribute set.
      Parameters:
      attrSetCollection - attribute set collection
      Returns:
      substituted string
    • substitute2

      public String substitute2(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