Skip to content

rkovarik/vaadin-json-binding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Json binding

PropertySet / Binder / Validator for JsonNode.

Usages

Reading / Writing

NumberField number = new NumberField();
JsonBinder binder = new JsonBinder();
binder.forField(number).bind("number");
binder.setBean(objectMapper.readTree("{\"number\" : \"2.0\"}));

Json schema validation

binder.withValidator(new JsonValidator(
        JsonSchemaFactory.builder(
                JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V7))
                .build()
                .getSchema("{\"required\": [\"number\"]}")
        )
);
Label statusLabel = new Label();
binder.setStatusLabel(statusLabel);
demo

Source code

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages