org.drools.lang
Class DroolsParserExceptionFactory

java.lang.Object
  extended by org.drools.lang.DroolsParserExceptionFactory

public class DroolsParserExceptionFactory
extends Object

Helper class that generates DroolsParserException with user friendly error messages.

See Also:
DroolsParserException

Field Summary
static String EARLY_EXIT_MESSAGE
           
static String FAILED_PREDICATE_MESSAGE
           
static String MISMATCHED_NOT_SET_MESSAGE
           
static String MISMATCHED_SET_MESSAGE
           
static String MISMATCHED_TOKEN_MESSAGE_COMPLETE
           
static String MISMATCHED_TOKEN_MESSAGE_PART
           
static String MISMATCHED_TREE_NODE_MESSAGE_COMPLETE
           
static String MISMATCHED_TREE_NODE_MESSAGE_PART
           
static String NO_VIABLE_ALT_MESSAGE
           
static String PARSER_LOCATION_MESSAGE_COMPLETE
           
static String PARSER_LOCATION_MESSAGE_PART
           
static String TRAILING_SEMI_COLON_NOT_ALLOWED_MESSAGE
           
static String UNEXPECTED_EXCEPTION
           
 
Constructor Summary
DroolsParserExceptionFactory(Stack<Map<DroolsParaphraseTypes,String>> paraphrases)
          DroolsParserErrorMessages constructor.
 
Method Summary
 DroolsParserException createDroolsException(Exception e, org.antlr.runtime.Token token)
           
 DroolsParserException createDroolsException(org.antlr.runtime.RecognitionException e)
          This method creates a DroolsParserException full of information.
 DroolsParserException createTrailingSemicolonException(int line, int column, int offset)
          This method creates a DroolsParserException for trailing semicolon exception, full of information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MISMATCHED_TOKEN_MESSAGE_COMPLETE

public static final String MISMATCHED_TOKEN_MESSAGE_COMPLETE
See Also:
Constant Field Values

MISMATCHED_TOKEN_MESSAGE_PART

public static final String MISMATCHED_TOKEN_MESSAGE_PART
See Also:
Constant Field Values

MISMATCHED_TREE_NODE_MESSAGE_COMPLETE

public static final String MISMATCHED_TREE_NODE_MESSAGE_COMPLETE
See Also:
Constant Field Values

MISMATCHED_TREE_NODE_MESSAGE_PART

public static final String MISMATCHED_TREE_NODE_MESSAGE_PART
See Also:
Constant Field Values

NO_VIABLE_ALT_MESSAGE

public static final String NO_VIABLE_ALT_MESSAGE
See Also:
Constant Field Values

EARLY_EXIT_MESSAGE

public static final String EARLY_EXIT_MESSAGE
See Also:
Constant Field Values

MISMATCHED_SET_MESSAGE

public static final String MISMATCHED_SET_MESSAGE
See Also:
Constant Field Values

MISMATCHED_NOT_SET_MESSAGE

public static final String MISMATCHED_NOT_SET_MESSAGE
See Also:
Constant Field Values

FAILED_PREDICATE_MESSAGE

public static final String FAILED_PREDICATE_MESSAGE
See Also:
Constant Field Values

TRAILING_SEMI_COLON_NOT_ALLOWED_MESSAGE

public static final String TRAILING_SEMI_COLON_NOT_ALLOWED_MESSAGE
See Also:
Constant Field Values

PARSER_LOCATION_MESSAGE_COMPLETE

public static final String PARSER_LOCATION_MESSAGE_COMPLETE
See Also:
Constant Field Values

PARSER_LOCATION_MESSAGE_PART

public static final String PARSER_LOCATION_MESSAGE_PART
See Also:
Constant Field Values

UNEXPECTED_EXCEPTION

public static final String UNEXPECTED_EXCEPTION
See Also:
Constant Field Values
Constructor Detail

DroolsParserExceptionFactory

public DroolsParserExceptionFactory(Stack<Map<DroolsParaphraseTypes,String>> paraphrases)
DroolsParserErrorMessages constructor.

Parameters:
tokenNames - tokenNames generated by ANTLR
paraphrases - paraphrases parser structure
Method Detail

createTrailingSemicolonException

public DroolsParserException createTrailingSemicolonException(int line,
                                                              int column,
                                                              int offset)
This method creates a DroolsParserException for trailing semicolon exception, full of information.

Parameters:
line - line number
column - column position
offset - char offset
Returns:
DroolsParserException filled.

createDroolsException

public DroolsParserException createDroolsException(org.antlr.runtime.RecognitionException e)
This method creates a DroolsParserException full of information.

Parameters:
e - original exception
Returns:
DroolsParserException filled.

createDroolsException

public DroolsParserException createDroolsException(Exception e,
                                                   org.antlr.runtime.Token token)


Copyright © 2001-2013 JBoss Inc.. All Rights Reserved.