public DataTokenizer buildTokenizerInstance( String tokenizerType ) {
        // Use a predefined list of known Tokenizers
        // TODO: publish more tokenizers... (when they are ready/good enough/abstract enough)
        if ("CSVTokenizer".equals( tokenizerType )) {
            return new CSVTokenizerImpl();
        }
        // Use the name of a class and instantiate this tokenizer
        try {
            // use classloader  and search for named class in class path...
            ClassLoader classLoader = this.getClass().getClassLoader();
            Class<?> loadedClass = classLoader.loadClass( tokenizerType );
            // TODO: check if superclass is registered as a DataTokenizer....
            // and check if it implements DataTokenizer
            Class<?>[] interfaces = loadedClass.getInterfaces();
            if (Arrays.asList( interfaces ).contains( DataTokenizer.class )) {
                // create the class using the unparametereized the constructor. 
                return (DataTokenizer) loadedClass.getDeclaredConstructor().newInstance();
            }
        }
        catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
                        | NoSuchMethodException | SecurityException e) {
            e.printStackTrace();
        }
        throw new IllegalArgumentException();
    }
public DataTokenizer buildTokenizerInstance( String tokenizerType ) {
       
       
        if ("CSVTokenizer".equals( tokenizerType )) {
            return new CSVTokenizerImpl();
        }
       
        try {
           
            ClassLoader classLoader = this.getClass().getClassLoader();
            Class<?> loadedClass = classLoader.loadClass( tokenizerType );
           
           
            Class<?>[] interfaces = loadedClass.getInterfaces();
            if (Arrays.asList( interfaces ).contains( DataTokenizer.class )) {
               
                return (DataTokenizer) loadedClass.getDeclaredConstructor().newInstance();
            }
        }
        catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException
                        | NoSuchMethodException | SecurityException e) {
            e.printStackTrace();
        }
        throw new IllegalArgumentException();
    }
public datatokenizer buildtokenizerinstance( string tokenizertype ) { if ("csvtokenizer".equals( tokenizertype )) { return new csvtokenizerimpl(); } try { classloader classloader = this.getclass().getclassloader(); class<?> loadedclass = classloader.loadclass( tokenizertype ); class<?>[] interfaces = loadedclass.getinterfaces(); if (arrays.aslist( interfaces ).contains( datatokenizer.class )) { return (datatokenizer) loadedclass.getdeclaredconstructor().newinstance(); } } catch (classnotfoundexception | instantiationexception | illegalaccessexception | illegalargumentexception | invocationtargetexception | nosuchmethodexception | securityexception e) { e.printstacktrace(); } throw new illegalargumentexception(); }