Search in sources :

Example 1 with FileDataSchemaResolver

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

the class SchemaTranslator method getResolver.

/**
 * Allows caller to specify a file path for schema resolution.
 */
private static DataSchemaResolver getResolver(SchemaParserFactory parserFactory, AvroToDataSchemaTranslationOptions options) {
    String resolverPath = options.getFileResolutionPaths();
    if (resolverPath != null) {
        FileDataSchemaResolver resolver = new FileDataSchemaResolver(parserFactory, resolverPath);
        resolver.setExtension(AVRO_FILE_EXTENSION);
        return resolver;
    } else {
        return new DefaultDataSchemaResolver(parserFactory);
    }
}
Also used : FileDataSchemaResolver(com.linkedin.data.schema.resolver.FileDataSchemaResolver) DefaultDataSchemaResolver(com.linkedin.data.schema.resolver.DefaultDataSchemaResolver)

Aggregations

DefaultDataSchemaResolver (com.linkedin.data.schema.resolver.DefaultDataSchemaResolver)1 FileDataSchemaResolver (com.linkedin.data.schema.resolver.FileDataSchemaResolver)1