public static boolean isVariable ( ASTNode expression , String pattern ) { return ( expression instanceof VariableExpression && ( ( VariableExpression ) expression ) . getName ( ) . matches ( pattern ) ) ; }
Tells you if the given ASTNode is a VariableExpression with the given name .