List of usage examples for org.apache.commons.lang.text StrSubstitutor DEFAULT_ESCAPE
char DEFAULT_ESCAPE
To view the source code for org.apache.commons.lang.text StrSubstitutor DEFAULT_ESCAPE.
Click Source Link
From source file:org.eurekastreams.server.action.execution.notification.notifier.NotificationMessageBuilderHelper.java
/** * Returns a variable-substituted version of the activity's body. * /*from w ww. j a v a 2 s. com*/ * @param activity * Activity. * @param context * Velocity context. * @return Activity body text. */ public String resolveActivityBody(final ActivityDTO activity, final Context context) { StrSubstitutor transform = new StrSubstitutor(new StrLookup() { @Override public String lookup(final String variableName) { if ("ACTORNAME".equals(variableName)) { return activity.getActor().getDisplayName(); } else { return null; } } }, VARIABLE_START_MARKER, VARIABLE_END_MARKER, StrSubstitutor.DEFAULT_ESCAPE); String result = transform.replace(activity.getBaseObjectProperties().get("content")); return result; }