Search in sources :

Example 1 with AbstractSchemaParser

use of com.linkedin.data.schema.AbstractSchemaParser in project rest.li by linkedin.

the class PdlEncoderTest method parseSchema.

private DataSchema parseSchema(String text, String name) throws IOException {
    DataSchemaResolver resolver = MultiFormatDataSchemaResolver.withBuiltinFormats(pegasusSrcDir.getAbsolutePath());
    AbstractSchemaParser parser = new PdlSchemaParser(resolver);
    parser.parse(text);
    return extractSchema(parser, name);
}
Also used : MultiFormatDataSchemaResolver(com.linkedin.data.schema.resolver.MultiFormatDataSchemaResolver) DataSchemaResolver(com.linkedin.data.schema.DataSchemaResolver) AbstractSchemaParser(com.linkedin.data.schema.AbstractSchemaParser) PdlSchemaParser(com.linkedin.data.schema.grammar.PdlSchemaParser)

Example 2 with AbstractSchemaParser

use of com.linkedin.data.schema.AbstractSchemaParser in project rest.li by linkedin.

the class PdlEncoderTest method parseSchema.

private DataSchema parseSchema(File file) throws IOException {
    DataSchemaResolver resolver = MultiFormatDataSchemaResolver.withBuiltinFormats(pegasusSrcDir.getAbsolutePath());
    AbstractSchemaParser parser = new PdlSchemaParser(resolver);
    parser.parse(new FileInputStream(file));
    return extractSchema(parser, file.getAbsolutePath());
}
Also used : MultiFormatDataSchemaResolver(com.linkedin.data.schema.resolver.MultiFormatDataSchemaResolver) DataSchemaResolver(com.linkedin.data.schema.DataSchemaResolver) AbstractSchemaParser(com.linkedin.data.schema.AbstractSchemaParser) PdlSchemaParser(com.linkedin.data.schema.grammar.PdlSchemaParser) FileInputStream(java.io.FileInputStream)

Aggregations

AbstractSchemaParser (com.linkedin.data.schema.AbstractSchemaParser)2 DataSchemaResolver (com.linkedin.data.schema.DataSchemaResolver)2 PdlSchemaParser (com.linkedin.data.schema.grammar.PdlSchemaParser)2 MultiFormatDataSchemaResolver (com.linkedin.data.schema.resolver.MultiFormatDataSchemaResolver)2 FileInputStream (java.io.FileInputStream)1