private void checkTokenOrderIsCorrect ( ESqlToken tokenTobeAdded ) { switch ( tokenTobeAdded ) { case COLUMN : if ( mPreviousToken != ESqlToken . CONDITION && mPreviousToken != ESqlToken . NOTHING ) { throw new D6RuntimeException ( "AND or OR method is required at here." + " '" + mSgSQL . toString ( ) + "'<==error occurred around here." ) ; } break ; case OPERATOR : if ( mPreviousToken != ESqlToken . COLUMN ) { throw new D6RuntimeException ( "VALUE is required at here." + " '" + mSgSQL . toString ( ) + "'<==error occurred around here." ) ; } break ; case VALUE : if ( mPreviousToken != ESqlToken . OPERATOR ) { throw new D6RuntimeException ( "COLUMN or PROPERTY method is required at here." + " '" + mSgSQL . toString ( ) + "'<==error occurred around here." ) ; } break ; case CONDITION : if ( mPreviousToken != ESqlToken . VALUE && mPreviousToken != ESqlToken . WHERE ) { throw new D6RuntimeException ( "VALUE is required at here." + " '" + mSgSQL . toString ( ) + "'<==error occurred around here." ) ; } break ; case WHERE : if ( mPreviousToken != ESqlToken . CONDITION && mPreviousToken != ESqlToken . NOTHING ) { throw new D6RuntimeException ( "CONDITION is required at here." + " '" + mSgSQL . toString ( ) + "'<==error occurred around here." ) ; } break ; default : } mPreviousToken = tokenTobeAdded ; }
Confirm whether the token is built in the correct order and throws an exception if there is a problem .