org.hibernate.hql.ast
public class: ErrorCounter [javadoc |
source]
java.lang.Object
org.hibernate.hql.ast.ErrorCounter
All Implemented Interfaces:
ParseErrorHandler
An error handler that counts parsing errors and warnings.
| Method from org.hibernate.hql.ast.ErrorCounter Detail: |
public int getErrorCount() {
return errorList.size();
}
|
public void reportError(RecognitionException e) {
reportError( e.toString() );
recognitionExceptions.add( e );
if ( log.isDebugEnabled() ) {
log.debug( e.toString(), e );
}
}
|
public void reportError(String message) {
hqlLog.error( message );
errorList.add( message );
}
|
public void reportWarning(String message) {
hqlLog.debug( message );
warningList.add( message );
}
|
public void throwQueryException() throws QueryException {
if ( getErrorCount() > 0 ) {
if ( recognitionExceptions.size() > 0 ) {
throw QuerySyntaxException.convert( ( RecognitionException ) recognitionExceptions.get( 0 ) );
}
else {
throw new QueryException( getErrorString() );
}
}
else {
// all clear
if ( log.isDebugEnabled() ) {
log.debug( "throwQueryException() : no errors" );
}
}
}
|