org.zodiac.template.velocity.support.InterpolationUtil Maven / Gradle / Ivy
The newest version!
package org.zodiac.template.velocity.support;
import org.apache.velocity.context.Context;
public class InterpolationUtil {
public static final String INTERPOLATE_KEY = "_INTERPOLATION_";
/**
* 如果当前正在解析StringLiteral
,则返回true
。
* 此特性需要打开velocity configuration: runtime.interpolate.string.literals.hack == true
。
*
* @param context context
* @return interpolated or not
*/
public static boolean isInInterpolation(Context context) {
return context.get(INTERPOLATE_KEY) instanceof Boolean;
}
}