public void parse ( String test ) throws ExceptionState { parser = new StateMachineParser ( ) ; test = test . trim ( ) ; if ( test . substring ( test . length ( ) - 4 ) . matches ( "V2\\.0" ) || test . substring ( test . length ( ) - 4 ) . matches ( "v2\\.0" ) ) { for ( int i = 0 ; i < test . length ( ) - 4 ; i ++ ) { parser . doAction ( test . charAt ( i ) ) ; } if ( ! ( parser . getState ( ) instanceof FinalState ) ) { LOG . error ( "Invalid input: Final State was not reached:" ) ; throw new FinalStateException ( "Invalid input: Final State was not reached" ) ; } } else { LOG . error ( "Invalid input: HELM2 standard is missing:" ) ; throw new NotValidHELM2Exception ( "Invalid input: HELM2 standard is missing" ) ; } }
method to parse the given HELM2 string in the case of an invalid HELM2 notation exception is thrown