@Test( expected = ParsingException.class ) public void shouldErrorWhenInvalidParserId() { final String content = getFileContent(DDL_TEST_FILE_PATH + "dialect/derby/derby_test_statements.ddl"); this.parsers.parseUsing(content, "BOGUS"); }
public AstNode parseUsing( final String ddl, final String parserId ) throws ParsingException { CheckArg.isNotEmpty(ddl, "ddl"); CheckArg.isNotEmpty(parserId, "parserId"); DdlParser parser = getParser(parserId); if (parser == null) { throw new ParsingException(Position.EMPTY_CONTENT_POSITION, DdlSequencerI18n.unknownParser.text(parserId)); } AstNode astRoot = createDdlStatementsContainer(parserId); parser.parse(ddl, astRoot, null); return astRoot; }
DdlParsers { public AstNode parseUsing( final String ddl, final String parserId ) throws ParsingException { CheckArg.isNotEmpty(ddl, "ddl"); CheckArg.isNotEmpty(parserId, "parserId"); DdlParser parser = getParser(parserId); if (parser == null) { throw new ParsingException(Position.EMPTY_CONTENT_POSITION, DdlSequencerI18n.unknownParser.text(parserId)); } AstNode astRoot = createDdlStatementsContainer(parserId); parser.parse(ddl, astRoot, null); return astRoot; } }
DdlParsers { public AstNode parseUsing( final String ddl, final String parserId ) throws ParsingException { CheckArg.isNotEmpty(ddl, "ddl"); CheckArg.isNotEmpty(parserId, "parserId"); DdlParser parser = getParser(parserId); if (parser == null) { throw new ParsingException(Position.EMPTY_CONTENT_POSITION, DdlSequencerI18n.unknownParser.text(parserId)); } AstNode astRoot = createDdlStatementsContainer(parserId); parser.parse(ddl, astRoot, null); return astRoot; } DdlParsers();  DdlParsers( List<DdlParser> parsers ); }
DdlParsers { public AstNode parseUsing( final String ddl, final String parserId ) throws ParsingException { CheckArg.isNotEmpty(ddl, "ddl"); CheckArg.isNotEmpty(parserId, "parserId"); DdlParser parser = getParser(parserId); if (parser == null) { throw new ParsingException(Position.EMPTY_CONTENT_POSITION, DdlSequencerI18n.unknownParser.text(parserId)); } AstNode astRoot = createDdlStatementsContainer(parserId); parser.parse(ddl, astRoot, null); return astRoot; } DdlParsers();  DdlParsers( List<DdlParser> parsers ); DdlParser getParser( final String id ); Set<DdlParser> getParsers(); AstNode parseUsing( final String ddl,
                               final String parserId ); List<ParsingResult> parseUsing( final String ddl,
                                           final String firstParserId,
                                           final String secondParserId,
                                           final String... additionalParserIds ); List<ParsingResult> parseUsingAll( final String ddl ); AstNode parse( final String ddl,
                          final String fileName ); }
DdlParsers { public AstNode parseUsing( final String ddl, final String parserId ) throws ParsingException { CheckArg.isNotEmpty(ddl, "ddl"); CheckArg.isNotEmpty(parserId, "parserId"); DdlParser parser = getParser(parserId); if (parser == null) { throw new ParsingException(Position.EMPTY_CONTENT_POSITION, DdlSequencerI18n.unknownParser.text(parserId)); } AstNode astRoot = createDdlStatementsContainer(parserId); parser.parse(ddl, astRoot, null); return astRoot; } DdlParsers();  DdlParsers( List<DdlParser> parsers ); DdlParser getParser( final String id ); Set<DdlParser> getParsers(); AstNode parseUsing( final String ddl,
                               final String parserId ); List<ParsingResult> parseUsing( final String ddl,
                                           final String firstParserId,
                                           final String secondParserId,
                                           final String... additionalParserIds ); List<ParsingResult> parseUsingAll( final String ddl ); AstNode parse( final String ddl,
                          final String fileName ); static final List<DdlParser> BUILTIN_PARSERS; }