@Test public void testGetFilterResolver_list() { Field field = new Field("severity", "Severity"); field.setListId(299); FilterResolver resolver = translateService.getFilterResolver(field); Assert.assertTrue(resolver instanceof MultipleItemsResolver); }
public FilterResolver getFilterResolver(Field field) { if(Type.class.isAssignableFrom(field.getClazz())) { Type type = (Type)project.getComponent(field.getClazz()); FilterResolver filterResolver = type.getFilterResolver(); if(filterResolver != null) { return filterResolver; } } if(field.getReferencedType() != null) { return new ExpressionResolver(getReferenceTranslator(field.getReferencedType())); } if(field.getListId() != null) { return new MultipleItemsResolver(); } return null; }
TranslateService implements ServerTypeListener { public FilterResolver getFilterResolver(Field field) { if(Type.class.isAssignableFrom(field.getClazz())) { Type type = (Type)project.getComponent(field.getClazz()); FilterResolver filterResolver = type.getFilterResolver(); if(filterResolver != null) { return filterResolver; } } if(field.getReferencedType() != null) { return new ExpressionResolver(getReferenceTranslator(field.getReferencedType())); } if(field.getListId() != null) { return new MultipleItemsResolver(); } return null; } }
TranslateService implements ServerTypeListener { public FilterResolver getFilterResolver(Field field) { if(Type.class.isAssignableFrom(field.getClazz())) { Type type = (Type)project.getComponent(field.getClazz()); FilterResolver filterResolver = type.getFilterResolver(); if(filterResolver != null) { return filterResolver; } } if(field.getReferencedType() != null) { return new ExpressionResolver(getReferenceTranslator(field.getReferencedType())); } if(field.getListId() != null) { return new MultipleItemsResolver(); } return null; } TranslateService(Project project, RestService restService); }
TranslateService implements ServerTypeListener { public FilterResolver getFilterResolver(Field field) { if(Type.class.isAssignableFrom(field.getClazz())) { Type type = (Type)project.getComponent(field.getClazz()); FilterResolver filterResolver = type.getFilterResolver(); if(filterResolver != null) { return filterResolver; } } if(field.getReferencedType() != null) { return new ExpressionResolver(getReferenceTranslator(field.getReferencedType())); } if(field.getListId() != null) { return new MultipleItemsResolver(); } return null; } 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 FilterResolver getFilterResolver(Field field) { if(Type.class.isAssignableFrom(field.getClazz())) { Type type = (Type)project.getComponent(field.getClazz()); FilterResolver filterResolver = type.getFilterResolver(); if(filterResolver != null) { return filterResolver; } } if(field.getReferencedType() != null) { return new ExpressionResolver(getReferenceTranslator(field.getReferencedType())); } if(field.getListId() != null) { return new MultipleItemsResolver(); } return null; } 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; }