private static boolean isPredefinedConstant ( Expression expression ) { if ( expression instanceof PropertyExpression ) { Expression object = ( ( PropertyExpression ) expression ) . getObjectExpression ( ) ; Expression property = ( ( PropertyExpression ) expression ) . getProperty ( ) ; if ( object instanceof VariableExpression ) { List < String > predefinedConstantNames = PREDEFINED_CONSTANTS . get ( ( ( VariableExpression ) object ) . getName ( ) ) ; if ( predefinedConstantNames != null && predefinedConstantNames . contains ( property . getText ( ) ) ) { return true ; } } } return false ; }
Tells you if the expression is a predefined constant like TRUE or FALSE .