private void constructTokenCollection ( final Reader reader ) throws MtasConfigException , MtasParserException { tokenCollection = null ; try { Constructor < ? > c = Class . forName ( parserName ) . getDeclaredConstructor ( MtasConfiguration . class ) ; Object p = c . newInstance ( parserConfiguration ) ; if ( p instanceof MtasParser ) { MtasParser parser = ( MtasParser ) p ; tokenCollection = parser . createTokenCollection ( reader ) ; return ; } else { throw new MtasConfigException ( "no instance of MtasParser" ) ; } } catch ( MtasParserException e ) { log . debug ( e ) ; tokenCollection = new MtasTokenCollection ( ) ; throw new MtasParserException ( e . getMessage ( ) ) ; } catch ( NoSuchMethodException | InvocationTargetException | IllegalAccessException | ClassNotFoundException | InstantiationException e ) { log . debug ( e ) ; throw new MtasConfigException ( e . getClass ( ) . getName ( ) + " : '" + e . getMessage ( ) + "'" ) ; } }
Construct token collection .