public static boolean isListLiteralWithOnlyConstantValues ( Expression expression ) { if ( expression instanceof ListExpression ) { List < Expression > expressions = ( ( ListExpression ) expression ) . getExpressions ( ) ; for ( Expression e : expressions ) { if ( ! isConstantOrConstantLiteral ( e ) ) { return false ; } } return true ; } return false ; }
Returns true if a List literal that contains only entries that are constants .