Skip to content

dOOv without code generation

ozangunalp edited this page Aug 2, 2018 · 2 revisions

Experimental


dOOv code generation is fast and reliable. However there are some use cases in which model annotation and code generation are not possible or preferable.

dOOv provides runtime APIs to create fields programmatically and use them in validation or mapping DSLs.

    public static final RuntimeField<SampleModel, String> EMAIL = from(SampleModel.class, SampleFieldId.EMAIL)
                    .readable("account email")
                    .get(SampleModel::getAccount, SampleModel::setAccount, Account::new)
                    .field(Account::getEmail, Account::setEmail, String.class)
                    .register(ALL);

TO COMPLETE