use of com.yahoo.elide.modelconfig.model.ElideTableConfig in project elide by yahoo.
the class DynamicConfigHelpers method stringToElideTablePojo.
/**
* Generates ElideTableConfig Pojo from input String.
* @param content : input string
* @param variables : variables to resolve.
* @param schemaValidator JSON schema validator.
* @return ElideTableConfig Pojo
* @throws IOException If an I/O error or a processing error occurs.
*/
public static ElideTableConfig stringToElideTablePojo(String fileName, String content, Map<String, Object> variables, DynamicConfigSchemaValidator schemaValidator) throws IOException {
ElideTableConfig table = new ElideTableConfig();
String jsonConfig = hjsonToJson(resolveVariables(content, variables));
try {
if (schemaValidator.verifySchema(Config.TABLE, jsonConfig, fileName)) {
table = getModelPojo(jsonConfig, ElideTableConfig.class);
}
} catch (ProcessingException e) {
log.error("Error Validating Table config : " + e.getMessage());
throw new IOException(e);
}
return table;
}
Aggregations