Package rife.render
Class Mask
java.lang.Object
rife.render.Mask
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
-
Constructor Details
-
Mask
public Mask()
-
-
Method Details
-
render
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 interfaceValueRenderer
- Parameters:
template
- the template to render the value invalueId
- the ID of the value to renderdifferentiator
- the differentiator of the value to render- Returns:
- the rendered value
- mask is the character to use for masking, defaulting to
-