Package rife.render
Class Abbreviate
java.lang.Object
rife.render.Abbreviate
- All Implemented Interfaces:
ValueRenderer
Abbreviates a template value with ellipses.
Usage:
<!--v render:rife.render.Abbreviate:valueId/--> {{v render:rife.render.Abbreviate:valueId/}}
- Since:
- 1.0
- Author:
- Erik C. Thauvin
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Abbreviate
public Abbreviate()
-
-
Method Details
-
render
Returns the template value abbreviated with ellipses.
Two parameters can be specified:
mark
: the string that will be used to abbreviate the value. Default is...
max
: the maximum number of characters to render. Default is-1
(no abbreviation).
- Specified by:
render
in interfaceValueRenderer
- Parameters:
template
- the template that contains the valuevalueId
- the id of the value to renderdifferentiator
- a generic string that can be used to differentiate the rendering- Returns:
- the abbreviated value, or the original value if no abbreviation is necessary
-