javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/OnReceive.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Fri, 05 Apr 2013 12:43:17 +0200
branchmodel
changeset 934 19b4ddc302a6
child 954 6448c284fe21
permissions -rw-r--r--
@OnReceive annotation can obtain and process single JSON object
jaroslav@934
     1
/**
jaroslav@934
     2
 * Back 2 Browser Bytecode Translator
jaroslav@934
     3
 * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jaroslav@934
     4
 *
jaroslav@934
     5
 * This program is free software: you can redistribute it and/or modify
jaroslav@934
     6
 * it under the terms of the GNU General Public License as published by
jaroslav@934
     7
 * the Free Software Foundation, version 2 of the License.
jaroslav@934
     8
 *
jaroslav@934
     9
 * This program is distributed in the hope that it will be useful,
jaroslav@934
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jaroslav@934
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
jaroslav@934
    12
 * GNU General Public License for more details.
jaroslav@934
    13
 *
jaroslav@934
    14
 * You should have received a copy of the GNU General Public License
jaroslav@934
    15
 * along with this program. Look for COPYING file in the top folder.
jaroslav@934
    16
 * If not, see http://opensource.org/licenses/GPL-2.0.
jaroslav@934
    17
 */
jaroslav@934
    18
package org.apidesign.bck2brwsr.htmlpage.api;
jaroslav@934
    19
jaroslav@934
    20
import java.lang.annotation.ElementType;
jaroslav@934
    21
import java.lang.annotation.Retention;
jaroslav@934
    22
import java.lang.annotation.RetentionPolicy;
jaroslav@934
    23
import java.lang.annotation.Target;
jaroslav@934
    24
jaroslav@934
    25
/** Static methods in classes annotated by {@link Model} or {@link Page}
jaroslav@934
    26
 * can be marked by this annotation establish a JSON communication point.
jaroslav@934
    27
 * The associated model page then gets new method to invoke a network
jaroslav@934
    28
 * connection 
jaroslav@934
    29
 * 
jaroslav@934
    30
 * @author Jaroslav Tulach <jtulach@netbeans.org>
jaroslav@934
    31
 */
jaroslav@934
    32
@Retention(RetentionPolicy.SOURCE)
jaroslav@934
    33
@Target(ElementType.METHOD)
jaroslav@934
    34
public @interface OnReceive {
jaroslav@934
    35
    /** The URL to connect to. Can contain variable names surrounded by '{' and '}'.
jaroslav@934
    36
     * Those parameters will then become variables of the associated method.
jaroslav@934
    37
     * 
jaroslav@934
    38
     * @return the (possibly parametrized) url to connect to
jaroslav@934
    39
     */
jaroslav@934
    40
    String url();
jaroslav@934
    41
}