@Override public Object fromJson(JsonNode node) { try { return getJSONParser().parseEntitySchema(node); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new RuntimeException(e); } } },"json-schema/metadata/schema.json");
@Override public Object fromJson(JsonNode node) { try { return getJSONParser().parseEntityMetadata(node); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new RuntimeException(e); } } }, "json-schema/metadata/metadata.json");
@Override public Object fromJson(JsonNode node) { try { return getJSONParser().parseEntityMetadata(node); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new RuntimeException(e); } } },"json-schema/metadata/metadata.json");
@Override public Object fromJson(JsonNode node) { try { return getJSONParser().parseEntityInfo(node); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new RuntimeException(e); } } }, "json-schema/metadata/entityInfo.json");
@Override public Object fromJson(JsonNode node) { try { return getJSONParser().parseEntitySchema(node); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new RuntimeException(e); } } }, "json-schema/metadata/schema.json");
@Override public Object fromJson(JsonNode node) { try { return getJSONParser().parseEntityInfo(node); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new RuntimeException(e); } } }, "json-schema/metadata/entityInfo.json");
@Override public Object fromJson(JsonNode node) { try { return getJSONParser().parseEntityInfo(node); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new RuntimeException(e); } } },"json-schema/metadata/entityInfo.json");
@Override public Object fromJson(JsonNode node) { try { return getJSONParser().parseEntitySchema(node); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new RuntimeException(e); } } }, "json-schema/metadata/schema.json");
@Override public Object fromJson(JsonNode node) { try { return getJSONParser().parseEntityMetadata(node); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new RuntimeException(e); } } }, "json-schema/metadata/metadata.json");
private synchronized void initializeMetadata() throws IOException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { if (metadata == null) { LOGGER.debug("Initializing metadata"); JsonNode root; try (InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(MetadataConfiguration.FILENAME)) { root = JsonUtils.json(is); } LOGGER.debug("Config root:{}", root); JsonNode cfgClass = root.get("type"); if (cfgClass == null) { throw new IllegalStateException(MetadataConstants.ERR_CONFIG_NOT_FOUND + " - type"); } MetadataConfiguration cfg = (MetadataConfiguration) Class.forName(cfgClass.asText()).newInstance(); cfg.initializeFromJson(root); // Set validation flag for all metadata requests getJsonTranslator().setValidation(EntityMetadata.class,cfg.isValidateRequests()); getJsonTranslator().setValidation(EntitySchema.class,cfg.isValidateRequests()); getJsonTranslator().setValidation(EntityInfo.class,cfg.isValidateRequests()); metadata = cfg.createMetadata(datasources, getJSONParser(), this); } }
private synchronized void initializeMetadata(Factory factory) throws IOException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { if (metadata == null) { LOGGER.debug("Initializing metadata"); MetadataConfiguration cfg = getMetadataConfiguration(); // Set validation flag for all metadata requests getJsonTranslator().setValidation(EntityMetadata.class, cfg.isValidateRequests()); getJsonTranslator().setValidation(EntitySchema.class, cfg.isValidateRequests()); getJsonTranslator().setValidation(EntityInfo.class, cfg.isValidateRequests()); metadata = cfg.createMetadata(datasources, getJSONParser(), this); factory.setHookResolver(new SimpleHookResolver(cfg.getHookConfigurationParsers(), this)); } }
private synchronized void initializeMetadata(Factory factory) throws IOException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { if (metadata == null) { LOGGER.debug("Initializing metadata"); MetadataConfiguration cfg = getMetadataConfiguration(); // Set validation flag for all metadata requests getJsonTranslator().setValidation(EntityMetadata.class, cfg.isValidateRequests()); getJsonTranslator().setValidation(EntitySchema.class, cfg.isValidateRequests()); getJsonTranslator().setValidation(EntityInfo.class, cfg.isValidateRequests()); metadata = cfg.createMetadata(datasources, getJSONParser(), this); factory.setHookResolver(new SimpleHookResolver(cfg.getHookConfigurationParsers(), this)); } }
getJSONParser(). getExtensions(). mergeWith(parserExtensions);
getJSONParser(). getExtensions(). mergeWith(parserExtensions);