Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package net.recommenders.rival.split.parser;
 
 import java.io.File;
Runner for the parser classes.

Author(s):
Alejandro
public class ParserRunner {

    
Variables that represent the name of several properties in the file.
    public static final String DATASET_FILE = "dataset.file";
    public static final String DATASET_PARSER = "dataset.parser";
    public static final String LASTFM_IDS_PREFIX = "dataset.parser.lastfm.idsprefix";
    public static final String LASTFM_USEARTISTS = "dataset.parser.lastfm.useartists";

    
Run the parser based on given properties.

        ..println("Parsing started");
        DataModel<LongLongmodel = null;
        File file = new File(properties.getProperty());
        String parserClassName = properties.getProperty();
        Class<?> parserClass = Class.forName(parserClassName);
        if (parserClassName.contains("LastfmCelma")) {
            String mapIdsPrefix = properties.getProperty();
            Boolean useArtists = Boolean.parseBoolean(properties.getProperty());
            Object parser = parserClass.getConstructor(boolean.class).newInstance(useArtists);
            model = (DataModel<LongLong>) parserClass.getMethod("parseData"File.classString.class).invoke(parserfilemapIdsPrefix);
        } else {
            Parser parser = (ParserparserClass.getConstructor().newInstance();
            model = parser.parseData(file);
        }
        ..println("Parsing finished");
        return model;
    }
New to GrepCode? Check out our FAQ X