javaquery/api/src/test/java/org/apidesign/bck2brwsr/htmlpage/PersonImpl.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Fri, 22 Feb 2013 08:59:40 +0100
branchmodel
changeset 770 26513bd377b9
child 876 4f02c384b13d
permissions -rw-r--r--
Introducing @Model for complex record-like types
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@770
    30
    @Property(name = "lastName", type = String.class)
jaroslav@770
    31
})
jaroslav@770
    32
final class PersonImpl {
jaroslav@770
    33
    @ComputedProperty 
jaroslav@770
    34
    public static String fullName(String firstName, String lastName) {
jaroslav@770
    35
        return firstName + " " + lastName;
jaroslav@770
    36
    }
jaroslav@770
    37
}