Skip to content
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

Support getter-only list. #334

Open
onacit opened this issue Aug 20, 2022 · 1 comment
Open

Support getter-only list. #334

onacit opened this issue Aug 20, 2022 · 1 comment

Comments

@onacit
Copy link

onacit commented Aug 20, 2022

Apologies whenever this issue is not appropriate.

May I have a chance of deserializing a collection field using a getter only?

public List<Some> getSome() { // JAXB used to work with this.
    if (some == null) {
        some = new ArrayList<>();
    }
    return some;
}

//public void setSome(List<Some> some) {
//    this.some = some;
//}

private List<Some> some;

Thank you.

@rmannibucau
Copy link

+1, we have a flag in johnzon for that (feature is named "use getter as writer" for collections).
There are a few cases it makes sense - often when reusing jaxb model as mentionned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants