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
Access.Level NONE for fields in Json #194
Comments
If there is appropriate ctor it will surely use that. There are many usages of that in examples and tests. |
well the problem is DSL compilation is trying to find matching constructor before Lombok generating classes itself hence DSL compiler assume that there will be always NO-ARG ctor only even if we have @AllArgsConstructor annotation. So generated convertor class is having no-arg ctor as initialisation mechanism and its ignoring Lombok generated All-arg Constructor reason why i am facing above issue. Note : If i am defining matching All-arg ctor in my Pojo then i am not facing any issue. Let me know if we can discuss this and try to find some solution if possible. |
Ugh... I don't think there is much to be done here ;( I think this question is more for Lombok community on how to setup pipeline so that everything is visible for the next annotation processor. |
not sure if there is any ordering for. annotation processor , anyways i can leave with it as of now but lets see if we can find some better solution , i will let you know if found anything. thanks as usual for providing quick support :). closing this as of now |
Hi @zapov ,
#177
similar to this issue , if we dont have Setter method available on fields ,then how should we populate that value from Json ??
the solution in above issue was for using @nonnull annotation with Access.Level NONE for Collection Types which we discussed but it seems like not working for normal fields like String , Object and all reference types .
My take is to use public constructor to populate those values instead of breaking encapsulation , what do you think ? what should be best way to do that ??
Below is Pojo class which is having issue. let me know if you need entire reproducible example.
@AllArgsConstructor
@NoArgsConstructor
@tostring
@getter
@Setter
@CompiledJson
public class PrivateSetterNonNull {
@JsonProperty(value = "test_string")
@nonnull
@Setter(AccessLevel.NONE)
private String testString;
}
The text was updated successfully, but these errors were encountered: