Java tutorial
//package com.java2s; public class Main { /** * Check if object is expression base on altSyntax * * @param value to treat as an expression * @return true if it is an expression */ public static boolean isExpression(Object value) { String expr = value.toString(); return expr.startsWith("%{") && expr.endsWith("}"); } }