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