private boolean containsSingleInterpolatoinLiteral(Expression exp, int recursionDepth) { if (exp == null) return false; // Just in case a loop ever gets into the AST somehow, try not fill the stack and such: if (recursionDepth > 20) return false; if (exp instanceof StringLiteral && ((StringLiteral) exp).isSingleInterpolationLiteral()) return true; int paramCnt = exp.getParameterCount(); for (int i = 0; i < paramCnt; i++) { Object paramValue = exp.getParameterValue(i); if (paramValue instanceof Expression) { boolean result = containsSingleInterpolatoinLiteral((Expression) paramValue, recursionDepth + 1); if (result) return true; } } return false; }
private boolean containsSingleInterpolatoinLiteral(Expression exp, int recursionDepth) { if (exp == null) return false; // Just in case a loop ever gets into the AST somehow, try not fill the stack and such: if (recursionDepth > 20) return false; if (exp instanceof StringLiteral && ((StringLiteral) exp).isSingleInterpolationLiteral()) return true; int paramCnt = exp.getParameterCount(); for (int i = 0; i < paramCnt; i++) { Object paramValue = exp.getParameterValue(i); if (paramValue instanceof Expression) { boolean result = containsSingleInterpolatoinLiteral((Expression) paramValue, recursionDepth + 1); if (result) return true; } } return false; }
private boolean containsSingleInterpolatoinLiteral(Expression exp, int recursionDepth) { if (exp == null) return false; // Just in case a loop ever gets into the AST somehow, try not fill the stack and such: if (recursionDepth > 20) return false; if (exp instanceof StringLiteral && ((StringLiteral) exp).isSingleInterpolationLiteral()) return true; int paramCnt = exp.getParameterCount(); for (int i = 0; i < paramCnt; i++) { Object paramValue = exp.getParameterValue(i); if (paramValue instanceof Expression) { boolean result = containsSingleInterpolatoinLiteral((Expression) paramValue, recursionDepth + 1); if (result) return true; } } return false; }