@Test public void mapsBapiStructureWithInheritedField() { final BapiMapping mapping = mapper.mapBapi(TestBapiClass.class); final TableMapping tableMapping = mapping.getTableParameters().iterator().next(); final Set<ParameterMapping> parameters = tableMapping.getComponentParameter().getParameters(); assertThat(parameters).hasSize(2) .extracting(ParameterMapping::getJavaName).containsOnly("structureParamSubClass", "structureParamSuperClass"); }
public BapiMapping mapBapi(final Class<?> clazz) { assertIsBapiClass(clazz); Bapi bapiAnnotation = clazz.getAnnotation(BAPI); BapiMapping bapiMapping = new BapiMapping(clazz, bapiAnnotation.value(), getErrorHandling(clazz)); Set<Field> fields = getDeclaredFieldsWithAnnotationRecursively(clazz, PARAMETER); for (Field field : fields) { addParameterToBapiMapping(bapiMapping, new BapiField(field)); } return bapiMapping; }
AnnotationBapiMapper { public BapiMapping mapBapi(final Class<?> clazz) { assertIsBapiClass(clazz); Bapi bapiAnnotation = clazz.getAnnotation(BAPI); BapiMapping bapiMapping = new BapiMapping(clazz, bapiAnnotation.value(), getErrorHandling(clazz)); Set<Field> fields = getDeclaredFieldsWithAnnotationRecursively(clazz, PARAMETER); for (Field field : fields) { addParameterToBapiMapping(bapiMapping, new BapiField(field)); } return bapiMapping; } }
AnnotationBapiMapper { public BapiMapping mapBapi(final Class<?> clazz) { assertIsBapiClass(clazz); Bapi bapiAnnotation = clazz.getAnnotation(BAPI); BapiMapping bapiMapping = new BapiMapping(clazz, bapiAnnotation.value(), getErrorHandling(clazz)); Set<Field> fields = getDeclaredFieldsWithAnnotationRecursively(clazz, PARAMETER); for (Field field : fields) { addParameterToBapiMapping(bapiMapping, new BapiField(field)); } return bapiMapping; }  }
AnnotationBapiMapper { public BapiMapping mapBapi(final Class<?> clazz) { assertIsBapiClass(clazz); Bapi bapiAnnotation = clazz.getAnnotation(BAPI); BapiMapping bapiMapping = new BapiMapping(clazz, bapiAnnotation.value(), getErrorHandling(clazz)); Set<Field> fields = getDeclaredFieldsWithAnnotationRecursively(clazz, PARAMETER); for (Field field : fields) { addParameterToBapiMapping(bapiMapping, new BapiField(field)); } return bapiMapping; }  BapiMapping mapBapi(final Class<?> clazz); }
AnnotationBapiMapper { public BapiMapping mapBapi(final Class<?> clazz) { assertIsBapiClass(clazz); Bapi bapiAnnotation = clazz.getAnnotation(BAPI); BapiMapping bapiMapping = new BapiMapping(clazz, bapiAnnotation.value(), getErrorHandling(clazz)); Set<Field> fields = getDeclaredFieldsWithAnnotationRecursively(clazz, PARAMETER); for (Field field : fields) { addParameterToBapiMapping(bapiMapping, new BapiField(field)); } return bapiMapping; }  BapiMapping mapBapi(final Class<?> clazz);  }