diff options
author | nenad <neno.nenadovic@gmail.com> | 2018-08-09 12:00:59 +0200 |
---|---|---|
committer | Ilia Motornyi <elmot@vaadin.com> | 2018-08-09 13:00:59 +0300 |
commit | 378d7f5a92338135829b8a28738e427a388faaf2 (patch) | |
tree | 7cdbb7266b53b8d26dcaab01094743fdabe77190 | |
parent | f423680c80705b72098ee412cc6d2fd9645a4ee9 (diff) | |
download | vaadin-framework-378d7f5a92338135829b8a28738e427a388faaf2.tar.gz vaadin-framework-378d7f5a92338135829b8a28738e427a388faaf2.zip |
Change documentation code samples to produce expected output (#11093)
-rw-r--r-- | documentation/datamodel/datamodel-items.asciidoc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/documentation/datamodel/datamodel-items.asciidoc b/documentation/datamodel/datamodel-items.asciidoc index 75a7c1ecf8..cfb3e7d44b 100644 --- a/documentation/datamodel/datamodel-items.asciidoc +++ b/documentation/datamodel/datamodel-items.asciidoc @@ -72,9 +72,14 @@ almost any POJOs with minimal requirements. ---- // Here is a bean (or more exactly a POJO) -class Person { +public class Person { String name; - int age; + int yearOfBirth; + + public Person(String name, int yearOfBirth) { + this.name = name; + this.yearOfBirth = yearOfBirth; + } public String getName() { return name; @@ -84,12 +89,12 @@ class Person { this.name = name; } - public Integer getAge() { - return age; + public int getYearOfBirth() { + return yearOfBirth; } - public void setAge(Integer age) { - this.age = age.intValue(); + public void setYearOfBirth(int yearOfBirth) { + this.yearOfBirth = yearOfBirth; } } @@ -156,7 +161,7 @@ item.addItemProperty("discoverername", // The other way is to use regular MethodProperty. item.addItemProperty("discovererborn", new MethodProperty<Person>(planet.getDiscoverer(), - "born")); + "yearOfBirth")); ---- The difference is that [classname]#NestedMethodProperty# does not access the |