Public:BWmeta service/Java mapping

From YaddaWiki

(Difference between revisions)
Jump to: navigation, search
(Created page with "{{Infobox BWmeta service}} == General contracts == * Every class has a public empty constructor. * Every setter and every list adder in every class returns <code>this</code>, w…")
Line 7: Line 7:
  new YElement()
  new YElement()
     .setId("bwmeta1.element.foo")
     .setId("bwmeta1.element.foo")
-
     .add(new YName().setText("Foo").setLanguage(YLanguage.English))
+
     .addName(new YName().setText("Foo").setLanguage(YLanguage.English))
-
     .addDescription(new YDescription().setText("Lorem ipsum"));
+
     .addDescription(new YDescription().setText("Lorem ipsum").setLanguage(YLanguage.Latin));
-
* ...
+
* Every property is protected, but has a public getter and setter.
 +
* Getters of <code>String</code>, <code>YLanguage</code> and <code>List</code> properties can never return <code>null</code>.  Instead, they return an empty <code>String</code>, <code>YLanguage.Undetermined</code> or an empty <code>List</code>, respectively.
-
=== Lists ===
+
<!-- * Only the following property types are present: a primitive type, a String, another "Y" object, a List of Strings or "Y" objects. -->

Revision as of 10:06, 27 September 2010

Service details
NameBWmeta
Code location
(relative to SVN root)
projects/dir/bwmeta-core
Javadoc
Contact personJakub Jurkiewicz

General contracts

  • Every class has a public empty constructor.
  • Every setter and every list adder in every class returns this, which allows chained setting, e.g.:
new YElement()
    .setId("bwmeta1.element.foo")
    .addName(new YName().setText("Foo").setLanguage(YLanguage.English))
    .addDescription(new YDescription().setText("Lorem ipsum").setLanguage(YLanguage.Latin));
  • Every property is protected, but has a public getter and setter.
  • Getters of String, YLanguage and List properties can never return null. Instead, they return an empty String, YLanguage.Undetermined or an empty List, respectively.


Personal tools