String rightValue,
String operator,
boolean isRightLiteral) {
// is it a literal? Does not include enums
if ( isRightLiteral ) {
return new LiteralRestrictionDescr(operator, exprDescr.isNegated(), exprDescr.getParameters(), rightValue, LiteralRestrictionDescr.TYPE_STRING);
}
// is it an enum?
int dotPos = rightValue.lastIndexOf( '.' );
if ( dotPos >= 0 ) {
final String mainPart = rightValue.substring( 0,
dotPos );
String lastPart = rightValue.substring( dotPos + 1 );
try {
context.getDialect().getTypeResolver().resolveType( mainPart );
if ( lastPart.indexOf( '(' ) < 0 && lastPart.indexOf( '.' ) < 0 && lastPart.indexOf( '[' ) < 0 ) {
return new LiteralRestrictionDescr(operator, exprDescr.isNegated(), exprDescr.getParameters(), rightValue, LiteralRestrictionDescr.TYPE_STRING );
}
} catch ( ClassNotFoundException e ) {
// do nothing as this is just probing to see if it was a class, which we now know it isn't :)
} catch ( NoClassDefFoundError e ) {
// do nothing as this is just probing to see if it was a class, which we now know it isn't :)