public static SelectedRule withRule ( String rule , ArgumentBuilder arguments ) throws Exception { if ( AunitRuntime . getTreeParserFactory ( ) == null ) throw new IllegalStateException ( "TreeParser factory not set by configuration" ) ; for ( Method method : collectMethods ( AunitRuntime . getTreeParserFactory ( ) . getTreeParserClass ( ) ) ) { if ( method . getName ( ) . equals ( rule ) ) { return new SelectedRule ( method , arguments . get ( ) ) ; } } throw new Exception ( "Rule " + rule + " not found" ) ; }
Select a tree rule be used as a starting point in tree walking