Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kyuff/validation-binder
Proof of Concept of using java.validation with JavaFX
https://github.com/kyuff/validation-binder
Last synced: 12 days ago
JSON representation
Proof of Concept of using java.validation with JavaFX
- Host: GitHub
- URL: https://github.com/kyuff/validation-binder
- Owner: kyuff
- License: apache-2.0
- Created: 2014-10-25T10:25:56.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-07-02T20:19:33.000Z (over 9 years ago)
- Last Synced: 2024-04-17T16:05:46.332Z (7 months ago)
- Language: Java
- Size: 293 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
validation-binder
=================Proof of Concept of using java.validation with JavaFX
Run the DemoApp to try it out.
Read motivation here: http://blog.kyuff.dk/2014/11/binding-to-bean-validations.html
EXAMPLE
=======This examples uses different bindings for the validator.
ValidationBinder validator = new BeanValidator<>(Person.class)
// simple binding - a normal use case
.bind(Handlers.messages(phoneErrors::setText), Person::getPhone)
// multi binding with chained handlers
.bind(Handlers.messages(nameErrors::setText).andThen(
Handlers.styling(nameBox, "error")
), pojo -> {
pojo.getFirstName();
pojo.getLastName();
}
)
// binding to fields in the entity object graph
.bind(Handlers.messages(carErrors::setText), pojo -> {
pojo.getCar().getEngine();
pojo.getCar().getPrice();
});