jaroslav@770
|
1 |
/**
|
jaroslav@770
|
2 |
* Back 2 Browser Bytecode Translator
|
jaroslav@770
|
3 |
* Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
|
jaroslav@770
|
4 |
*
|
jaroslav@770
|
5 |
* This program is free software: you can redistribute it and/or modify
|
jaroslav@770
|
6 |
* it under the terms of the GNU General Public License as published by
|
jaroslav@770
|
7 |
* the Free Software Foundation, version 2 of the License.
|
jaroslav@770
|
8 |
*
|
jaroslav@770
|
9 |
* This program is distributed in the hope that it will be useful,
|
jaroslav@770
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
jaroslav@770
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
jaroslav@770
|
12 |
* GNU General Public License for more details.
|
jaroslav@770
|
13 |
*
|
jaroslav@770
|
14 |
* You should have received a copy of the GNU General Public License
|
jaroslav@770
|
15 |
* along with this program. Look for COPYING file in the top folder.
|
jaroslav@770
|
16 |
* If not, see http://opensource.org/licenses/GPL-2.0.
|
jaroslav@770
|
17 |
*/
|
jaroslav@770
|
18 |
package org.apidesign.bck2brwsr.htmlpage;
|
jaroslav@770
|
19 |
|
jaroslav@770
|
20 |
import org.apidesign.bck2brwsr.htmlpage.api.ComputedProperty;
|
jaroslav@770
|
21 |
import org.apidesign.bck2brwsr.htmlpage.api.Model;
|
jaroslav@770
|
22 |
import org.apidesign.bck2brwsr.htmlpage.api.Property;
|
jaroslav@770
|
23 |
|
jaroslav@770
|
24 |
/**
|
jaroslav@770
|
25 |
*
|
jaroslav@770
|
26 |
* @author Jaroslav Tulach <jtulach@netbeans.org>
|
jaroslav@770
|
27 |
*/
|
jaroslav@770
|
28 |
@Model(className = "Person", properties = {
|
jaroslav@770
|
29 |
@Property(name = "firstName", type = String.class),
|
jaroslav@876
|
30 |
@Property(name = "lastName", type = String.class),
|
jaroslav@876
|
31 |
@Property(name = "male", type = boolean.class)
|
jaroslav@770
|
32 |
})
|
jaroslav@770
|
33 |
final class PersonImpl {
|
jaroslav@770
|
34 |
@ComputedProperty
|
jaroslav@770
|
35 |
public static String fullName(String firstName, String lastName) {
|
jaroslav@770
|
36 |
return firstName + " " + lastName;
|
jaroslav@770
|
37 |
}
|
jaroslav@876
|
38 |
|
jaroslav@876
|
39 |
@ComputedProperty
|
jaroslav@876
|
40 |
public static String sex(boolean male) {
|
jaroslav@876
|
41 |
return male ? "Male" : "Female";
|
jaroslav@876
|
42 |
}
|
jaroslav@770
|
43 |
}
|