public static String escapeSinglePart( String part ) { if (isReservedWord(part)) { return ID_ESCAPE_CHAR + part + ID_ESCAPE_CHAR; } boolean escape = true; char start = part.charAt(0); if (start == '#' || start == '@' || StringUtil.isLetter(start)) { escape = false; for (int i = 1; !escape && i < part.length(); i++) { char c = part.charAt(i); escape = !StringUtil.isLetterOrDigit(c) && c != '_'; } } if (escape) { return ID_ESCAPE_CHAR + escapeStringValue(part, "\"") + ID_ESCAPE_CHAR; //$NON-NLS-1$ } return part; }
public static String escapeSinglePart( String part ) { if (isReservedWord(part)) { return ID_ESCAPE_CHAR + part + ID_ESCAPE_CHAR; } boolean escape = true; char start = part.charAt(0); if (start == '#' || start == '@' || StringUtil.isLetter(start)) { escape = false; for (int i = 1; !escape && i < part.length(); i++) { char c = part.charAt(i); escape = !StringUtil.isLetterOrDigit(c) && c != '_'; } } if (escape) { return ID_ESCAPE_CHAR + escapeStringValue(part, "\"") + ID_ESCAPE_CHAR; //$NON-NLS-1$ } return part; }
public static String escapeSinglePart( String part ) { if (isReservedWord(part)) { return ID_ESCAPE_CHAR + part + ID_ESCAPE_CHAR; } boolean escape = true; char start = part.charAt(0); if (start == '#' || start == '@' || StringUtil.isLetter(start)) { escape = false; for (int i = 1; !escape && i < part.length(); i++) { char c = part.charAt(i); escape = !StringUtil.isLetterOrDigit(c) && c != '_'; } } if (escape) { return ID_ESCAPE_CHAR + escapeStringValue(part, "\"") + ID_ESCAPE_CHAR; //$NON-NLS-1$ } return part; }