class JexlASTHelper {

    public static JexlNode findLiteral(JexlNode node) {
        if (node instanceof Literal<?>) {
            return node;
        }
        
        for (JexlNode child : JexlNodes.children(node)) {
            JexlNode test = findLiteral(child);
            if (test != null && test instanceof Literal<?>) {
                return test;
            }
        }
        
        return null;
    }

    private  JexlASTHelper();

}