Search in sources :

Example 1 with ParserProvider

use of water.parser.ParserProvider in project h2o-3 by h2oai.

the class ParseSetupV3 method fillImpl.

@Override
public ParseSetup fillImpl(ParseSetup impl) {
    ParseSetup parseSetup = fillImpl(impl, new String[] { "parse_type" });
    // Transform the field parse_type
    ParserInfo pi = GUESS_INFO;
    if (this.parse_type != null) {
        ParserProvider pp = ParserService.INSTANCE.getByName(this.parse_type);
        if (pp != null) {
            pi = pp.info();
        } else
            throw new H2OIllegalValueException("Cannot find right parser for specified parser type!", this.parse_type);
    }
    parseSetup.setParseType(pi);
    return parseSetup;
}
Also used : ParseSetup(water.parser.ParseSetup) ParserInfo(water.parser.ParserInfo) ParserProvider(water.parser.ParserProvider) H2OIllegalValueException(water.exceptions.H2OIllegalValueException)

Aggregations

H2OIllegalValueException (water.exceptions.H2OIllegalValueException)1 ParseSetup (water.parser.ParseSetup)1 ParserInfo (water.parser.ParserInfo)1 ParserProvider (water.parser.ParserProvider)1