1 package org.hibernate.hql.classic; 3 4 import org.hibernate.QueryException; 5 import org.hibernate.util.StringHelper; 6 7 import java.util.StringTokenizer ; 8 9 public final class ParserHelper { 10 11 public static final String HQL_VARIABLE_PREFIX = ":"; 12 13 public static final String HQL_SEPARATORS = " \n\r\f\t,()=<>&|+-=/*'^![]#~\\"; 14 public static final String PATH_SEPARATORS = "."; 16 17 public static boolean isWhitespace(String str) { 18 return StringHelper.WHITESPACE.indexOf( str ) > -1; 19 } 20 21 private ParserHelper() { 22 } 24 25 public static void parse(Parser p, String text, String seperators, QueryTranslatorImpl q) throws QueryException { 26 StringTokenizer tokens = new StringTokenizer ( text, seperators, true ); 27 p.start( q ); 28 while ( tokens.hasMoreElements() ) p.token( tokens.nextToken(), q ); 29 p.end( q ); 30 } 31 32 } 33 34 35 36 37 38 39 | Popular Tags |