public BindablePropertySetAdapter<Object> newBindablePropertySetAdapter() { return new BackendBindablePropertySetAdapter<>(); } }
public BindablePropertyAdapter newBindablePropertyAdapter() { return new BackendBindablePropertyAdapter(); }
@Override public Set<String> getDefinitions(final T definitionSet) { return getAnnotatedDefinitions(definitionSet); }
@Override public String getCaption(final T property) { Class<?> type = property.getClass(); try { return getFieldValue(property, propertyCaptionFieldNames.get(type)); } catch (IllegalAccessException e) { LOG.error("Error obtaining caption for Property with id " + getId(property)); } return null; }
@Before public void setUp() { super.setUp(); tested = new BackendBindablePropertySetAdapter(); tested.setBindings(propertyNameFields, propertiesFieldNames); propertiesFieldNames.put(instancePropertySet.getClass(), Stream.of(FooPropertySetTestBean.FOO_PROPERTY_NAME).collect(Collectors.toSet())); }
@Before public void setUp() { super.setUp(); tested = new BackendBindableDefinitionAdapter(utils); tested.setBindings(metaPropertyTypeClasses, baseTypes, propertySetsFieldNames, propertiesFieldNames, propertyGraphFactoryFieldNames, propertyIdFieldNames, propertyLabelsFieldNames, propertyTitleFieldNames, propertyCategoryFieldNames, propertyDescriptionFieldNames, propertyNameFields); propertyNameFields.put(instance.getClass(), FooTestBean.FOO_PROPERTY_NAME); propertiesFieldNames.put(instance.getClass(), Stream.of(FooTestBean.FOO_PROPERTY_NAME).collect(Collectors.toSet())); }
public BindableDefinitionAdapter newBindableDefinitionAdapter() { return new BackendBindableDefinitionAdapter(definitionUtils); }
@Override public String getName(final T propertySet) { Class<?> type = propertySet.getClass(); try { return getFieldValue(propertySet, propertyNameFieldNames.get(type)); } catch (IllegalAccessException e) { LOG.error("Error obtaining name for Property Set with id " + getId(propertySet)); } return null; }
@Override public Set<?> getProperties(final T propertySet) { Class<?> type = propertySet.getClass(); Set<String> fields = propertiesFieldNames.get(type); try { return getFieldValues(propertySet, fields); } catch (IllegalAccessException e) { LOG.error("Error obtaining properties for Property Set with id " + getId(propertySet)); } return null; }
@Override public String getDescription(final T definitionSet) { Class<?> type = definitionSet.getClass(); try { return getFieldValue(definitionSet, propertyDescriptionFieldNames.get(type)); } catch (IllegalAccessException e) { LOG.error("Error obtaining description for Definition Set with id " + getId(definitionSet)); } return null; }
public BindableDefinitionSetAdapter newBindableDefinitionSetAdapter() { return new BackendBindableDefinitionSetAdapter(); }
@PostConstruct public void init() { initMorphDefinitions(); }
@Override public String getCategory(final T definition) { Class<?> type = definition.getClass(); try { return getFieldValue(definition, propertyCategoryFieldNames.get(type)); } catch (IllegalAccessException e) { LOG.error("Error obtaining category for Definition with id " + getId(definition)); } return null; }
@Test public void getNameField() { final Optional nameField = tested.getNameField(instance); assertEquals(nameField.get(), instance.fooProperty); }
@Test public void getPropertyByName() { final Optional property = tested.getProperty(instance, FooTestBean.FOO_PROPERTY_NAME); assertEquals(property.get(), instance.fooProperty); } }
@Test public void getPropertyByName() { final Optional property = tested.getProperty(instancePropertySet, FooPropertySetTestBean.FOO_PROPERTY_NAME); assertEquals(property.get(), instancePropertySet.fooProperty); } }
@Override public String getDescription(final T property) { Class<?> type = property.getClass(); try { return getFieldValue(property, propertyDescriptionFieldNames.get(type)); } catch (IllegalAccessException e) { LOG.error("Error obtaining description for Property with id " + getId(property)); } return null; }
@Override public boolean isReadOnly(final T property) { Class<?> type = property.getClass(); try { return getFieldValue(property, propertyReadOnlyFieldNames.get(type)); } catch (IllegalAccessException e) { LOG.error("Error obtaining read only flag for Property with id " + getId(property)); } return false; }
@Override public boolean isOptional(final T property) { Class<?> type = property.getClass(); try { return getFieldValue(property, propertyOptionalFieldNames.get(type)); } catch (IllegalAccessException e) { LOG.error("Error obtaining optional flag for Property with id " + getId(property)); } return true; }
@Override public V getValue(final T property) { Class<?> type = property.getClass(); try { return getFieldValue(property, propertyValueFieldNames.get(type)); } catch (IllegalAccessException e) { LOG.error("Error obtaining value for Property with id " + getId(property)); } return null; }