/** * Registers a translation with the given schema for a POJO with a static * factory method getting a JsonNode argument * * @param clazz The POJO class that will be returned when a JSON document of * this type is parsed * @param schema The JSON schema */ public void registerTranslation(Class clazz, JsonSchema schema) throws NoSuchMethodException { registerTranslation(clazz, new StaticFactoryMethod(clazz, "fromJson"), schema); }
/** * @param controllers the controllers to set */ public void setControllers(ControllerConfiguration[] controllers) { this.controllers = copyControllerArray(controllers); }
public Mediator getMediator() throws ClassNotFoundException, IllegalAccessException, InvocationTargetException, IOException, NoSuchMethodException, InstantiationException { if (mediator == null) { initializeMediator(); } return mediator; }
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)); } }
public JSONMetadataParser getJSONParser() throws ClassNotFoundException, NoSuchMethodException, IOException, IllegalAccessException, InvocationTargetException, InstantiationException { if (parser == null) { initializeParser(); // Metadata is loaded next because the hooks need to be registered on the Factory. getMetadata(); } return parser; }
/** * Sets the validation flag for all POJOs */ public void setAllValidation(boolean validate) { setValidation(Object.class, validate); }
private ControllerConfiguration[] copyControllerArray(ControllerConfiguration[] source) { ControllerConfiguration[] theCopy = new ControllerConfiguration[source.length]; for (int i = 0; i < source.length; i++) { theCopy[i] = new ControllerConfiguration(source[i]); } return theCopy; }
public CrudConfiguration getCrudConfiguration() throws IOException { if(crudConfiguration==null) initializeCrudConfiguration(); return crudConfiguration; }
void injectDependencies(Object o) { if (o instanceof LightblueFactoryAware) { ((LightblueFactoryAware) o).setLightblueFactory(this); } }
public JSONMetadataParser getJSONParser() throws ClassNotFoundException, NoSuchMethodException, IOException, IllegalAccessException, InvocationTargetException, InstantiationException { if (parser == null) { initializeParser(); getMetadata(); } return parser; }
/** * Registers a translation with the given schema for a POJO with a * static factory method getting a JsonNode argument * * @param clazz The POJO class that will be returned when a JSON * document of this type is parsed * @param schema The JSON schema */ public void registerTranslation(Class clazz,JsonSchema schema) throws NoSuchMethodException { registerTranslation(clazz,new StaticFactoryMethod(clazz,"fromJson"),schema); }
/** * @param controllers the controllers to set */ public void setControllers(ControllerConfiguration[] controllers) { this.controllers = copyControllerArray(controllers); }
public Mediator getMediator() throws ClassNotFoundException, IllegalAccessException, InvocationTargetException, IOException, NoSuchMethodException, InstantiationException { if (mediator == null) { initializeMediator(); } return mediator; }
/** * Sets the validation flag for all POJOs */ public void setAllValidation(boolean validate) { setValidation(Object.class,validate); }
public CrudConfiguration getCrudConfiguration() throws IOException { if(crudConfiguration==null) initializeCrudConfiguration(); return crudConfiguration; }
public JSONMetadataParser getJSONParser() throws ClassNotFoundException, NoSuchMethodException, IOException, IllegalAccessException, InvocationTargetException, InstantiationException { if (parser == null) { initializeParser(); // Metadata is loaded next because the hooks need to be registered on the Factory. getMetadata(); } return parser; }
/** * Registers a translation with the given schema for a POJO with a static * factory method getting a JsonNode argument * * @param clazz The POJO class that will be returned when a JSON document of * this type is parsed * @param schema The JSON schema */ public void registerTranslation(Class clazz, JsonSchema schema) throws NoSuchMethodException { registerTranslation(clazz, new StaticFactoryMethod(clazz, "fromJson"), schema); }
/** * @return the controllers */ public ControllerConfiguration[] getControllers() { return copyControllerArray(controllers); }
/** * @return the controllers */ public ControllerConfiguration[] getControllers() { return copyControllerArray(controllers); }
/** * @return the controllers */ public ControllerConfiguration[] getControllers() { return copyControllerArray(controllers); }