@Test public void testConvertQueryModelToView() { Field field = new Field("status", "Status"); field.setClazz(BuildStatusType.class); handler.async(); String value = translateService.convertQueryModelToView(field, "Success;\"\"", new ValueCallback() { @Override public void value(final String value) { handler.done(new Runnable() { @Override public void run() { Assert.assertEquals("Success;(no value)", value); } }); } }); Assert.assertEquals("Success;(no value)", value); }
public String convertQueryModelToView(Field field, String value, ValueCallback callback) { FilterResolver resolver = getFilterResolver(field); if(resolver != null) { return resolver.resolveDisplayValue(value, callback); } else { callback.value(value); return value; } }
TranslateService implements ServerTypeListener { public String convertQueryModelToView(Field field, String value, ValueCallback callback) { FilterResolver resolver = getFilterResolver(field); if(resolver != null) { return resolver.resolveDisplayValue(value, callback); } else { callback.value(value); return value; } } }
TranslateService implements ServerTypeListener { public String convertQueryModelToView(Field field, String value, ValueCallback callback) { FilterResolver resolver = getFilterResolver(field); if(resolver != null) { return resolver.resolveDisplayValue(value, callback); } else { callback.value(value); return value; } } TranslateService(Project project, RestService restService); }
TranslateService implements ServerTypeListener { public String convertQueryModelToView(Field field, String value, ValueCallback callback) { FilterResolver resolver = getFilterResolver(field); if(resolver != null) { return resolver.resolveDisplayValue(value, callback); } else { callback.value(value); return value; } } TranslateService(Project project, RestService restService); boolean isTranslated(Field field); String convertQueryModelToREST(Field field, String value); String convertQueryModelToView(Field field, String value, ValueCallback callback); FilterResolver getFilterResolver(Field field); Translator getTranslator(Field field); Translator getReferenceTranslator(String targetType); String translateAsync(Field field, final String value, boolean syncCall, final ValueCallback onValue); String translateAsync(Translator translator, final String value, boolean syncCall, final ValueCallback onValue); @Override void connectedTo(ServerType serverType); }
TranslateService implements ServerTypeListener { public String convertQueryModelToView(Field field, String value, ValueCallback callback) { FilterResolver resolver = getFilterResolver(field); if(resolver != null) { return resolver.resolveDisplayValue(value, callback); } else { callback.value(value); return value; } } TranslateService(Project project, RestService restService); boolean isTranslated(Field field); String convertQueryModelToREST(Field field, String value); String convertQueryModelToView(Field field, String value, ValueCallback callback); FilterResolver getFilterResolver(Field field); Translator getTranslator(Field field); Translator getReferenceTranslator(String targetType); String translateAsync(Field field, final String value, boolean syncCall, final ValueCallback onValue); String translateAsync(Translator translator, final String value, boolean syncCall, final ValueCallback onValue); @Override void connectedTo(ServerType serverType); static final String LOADING_MESSAGE; static final String NA_TOKEN; }