Package rife.render

Class Mask

java.lang.Object
rife.render.Mask
All Implemented Interfaces:
ValueRenderer

public class Mask extends Object implements ValueRenderer

Masks characters of a template value.

Usage:

   <!--v render:rife.render.Mask:valueId/-->
   {{v render:rife.render.Mask:valueId/}}
 
Since:
1.0
Author:
Erik C. Thauvin
See Also:
  • Constructor Details

    • Mask

      public Mask()
  • Method Details

    • render

      public String render(Template template, String valueId, String differentiator)

      Renders a template value with characters of the value masked using the specified mask.

      The mask is specified as a template default value with the following syntax:

         mask=<mask>[,unmasked=<unmasked>][,fromStart=<fromStart>]
       

      Where:

      • mask is the character to use for masking, defaulting to *
      • unmasked is the number of characters at the beginning of the value that should be left unmasked, defaulting to 0
      • fromStart is a boolean indicating whether the unmasked value should be counted from the start of the value, defaulting to false
      Specified by:
      render in interface ValueRenderer
      Parameters:
      template - the template to render the value in
      valueId - the ID of the value to render
      differentiator - the differentiator of the value to render
      Returns:
      the rendered value