@Test public void testGetProperties() { String[] propertyFields = tested.getPropertyFields(instance); assertEquals(2, propertyFields.length); assertEquals("fooPropertySet.fooProperty", propertyFields[0]); assertEquals("fooProperty", propertyFields[1]); Optional<?> p0 = tested.getProperty(instance, "fooPropertySet.fooProperty"); assertTrue(p0.isPresent()); assertEquals(instance.fooPropertySet.fooProperty, p0.get()); Optional<?> p1 = tested.getProperty(instance, "fooProperty"); assertTrue(p1.isPresent()); assertEquals(instance.fooProperty, p1.get()); }
@Override public String[] getPropertyFields(final T pojo) { final List<String> fields = visitFields(pojo.getClass(), field -> null != field.getAnnotation(Property.class)); return fields.toArray(new String[fields.size()]); }
BackendDefinitionAdapter extends AbstractReflectAdapter<T> implements DefinitionAdapter<T>,
                   HasInheritance { @Override public String[] getPropertyFields(final T pojo) { final List<String> fields = visitFields(pojo.getClass(), field -> null != field.getAnnotation(Property.class)); return fields.toArray(new String[fields.size()]); } }
BackendDefinitionAdapter extends AbstractReflectAdapter<T> implements DefinitionAdapter<T>,
                   HasInheritance { @Override public String[] getPropertyFields(final T pojo) { final List<String> fields = visitFields(pojo.getClass(), field -> null != field.getAnnotation(Property.class)); return fields.toArray(new String[fields.size()]); } @Inject  BackendDefinitionAdapter(); }
BackendDefinitionAdapter extends AbstractReflectAdapter<T> implements DefinitionAdapter<T>,
                   HasInheritance { @Override public String[] getPropertyFields(final T pojo) { final List<String> fields = visitFields(pojo.getClass(), field -> null != field.getAnnotation(Property.class)); return fields.toArray(new String[fields.size()]); } @Inject  BackendDefinitionAdapter(); @Override boolean accepts(Class<?> pojo); @Override DefinitionId getId(final T definition); @Override String[] getPropertyFields(final T pojo); @Override String getMetaPropertyField(final T pojo,
                                       final PropertyMetaTypes metaType); @Override String getCategory(final T definition); @Override String getTitle(final T definition); @Override String getDescription(final T definition); @Override @SuppressWarnings("all") String[] getLabels(final T definition); @Override Class<? extends ElementFactory> getGraphFactoryType(final T definition); static Class<? extends ElementFactory> getGraphFactory(final Class<?> type); @Override String getBaseType(final Class<?> type); @Override String[] getTypes(final String baseType); }
BackendDefinitionAdapter extends AbstractReflectAdapter<T> implements DefinitionAdapter<T>,
                   HasInheritance { @Override public String[] getPropertyFields(final T pojo) { final List<String> fields = visitFields(pojo.getClass(), field -> null != field.getAnnotation(Property.class)); return fields.toArray(new String[fields.size()]); } @Inject  BackendDefinitionAdapter(); @Override boolean accepts(Class<?> pojo); @Override DefinitionId getId(final T definition); @Override String[] getPropertyFields(final T pojo); @Override String getMetaPropertyField(final T pojo,
                                       final PropertyMetaTypes metaType); @Override String getCategory(final T definition); @Override String getTitle(final T definition); @Override String getDescription(final T definition); @Override @SuppressWarnings("all") String[] getLabels(final T definition); @Override Class<? extends ElementFactory> getGraphFactoryType(final T definition); static Class<? extends ElementFactory> getGraphFactory(final Class<?> type); @Override String getBaseType(final Class<?> type); @Override String[] getTypes(final String baseType);  }