-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#135 Support more ways to create beans (e.g. Java records) #398
base: master
Are you sure you want to change the base?
Conversation
src/main/java/ch/jalu/configme/beanmapper/instantiation/BeanInstantiationService.java
Show resolved
Hide resolved
src/main/java/ch/jalu/configme/beanmapper/instantiation/BeanInstantiationServiceImpl.java
Show resolved
Hide resolved
src/main/java/ch/jalu/configme/beanmapper/instantiation/BeanInstantiationServiceImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/jalu/configme/internal/record/ReflectionHelper.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/jalu/configme/beanmapper/instantiation/BeanInstantiationServiceImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/ch/jalu/configme/beanmapper/instantiation/BeanInstantiationServiceImpl.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adapt javadoc on MapperImpl
src/main/java/ch/jalu/configme/beanmapper/propertydescription/BeanDescriptionFactory.java
Show resolved
Hide resolved
68bfefe
to
0a8e9bd
Compare
protected @NotNull List<BeanPropertyDescription> getBeanProperties(@NotNull Object value) { | ||
return beanInstantiationService.findInstantiation(value.getClass()) | ||
.map(BeanInstantiation::getProperties) | ||
.orElse(Collections.emptyList()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting to note that here a bean instantiation is retrieved during the export to find out what properties it has. Maybe "instantiation" is not a good name? No better idea at the time of writing
...t/java/ch/jalu/configme/beanmapper/propertydescription/BeanFieldPropertyDescriptionTest.java
Outdated
Show resolved
Hide resolved
private String name; // Ignore name of parent | ||
|
||
@ExportName("o_ratio") | ||
private float ratio; // Override name of Middle#ratio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Wiki should have an example like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check behavior when a class has no bean instantiation: I think there was some weird behavior. Mapping should be stopped.
* <p> | ||
* Default implementation is {@link BeanPropertyDescriptionImpl}. | ||
* Default implementation of this interface is {@link BeanFieldPropertyDescription}. | ||
*/ | ||
public interface BeanPropertyDescription { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not fully happy with the names here. Is Description right? Should it be just BeanComponent
?
What about the BeanDescriptionFactory
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably need to create another issue to change the mapping context. It should be able to have more info to support generic types in the future.
No description provided.