javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/OnReceive.java
branchmodel
changeset 1023 ad9a37489365
parent 964 df60ba2aeb87
child 1787 ea12a3bb4b33
     1.1 --- a/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/OnReceive.java	Wed Apr 10 12:19:32 2013 +0200
     1.2 +++ b/javaquery/api/src/main/java/org/apidesign/bck2brwsr/htmlpage/api/OnReceive.java	Fri Apr 26 13:48:36 2013 +0200
     1.3 @@ -22,54 +22,14 @@
     1.4  import java.lang.annotation.RetentionPolicy;
     1.5  import java.lang.annotation.Target;
     1.6  
     1.7 -/** Static methods in classes annotated by {@link Page}
     1.8 - * can be marked by this annotation to establish a 
     1.9 - * <a href="http://en.wikipedia.org/wiki/JSON">JSON</a>
    1.10 - * communication point.
    1.11 - * The associated model page then gets new method to invoke a network
    1.12 - * connection. Example follows:
    1.13 - * 
    1.14 - * <pre>
    1.15 - * {@link Page @Page}(className="MyModel", xhtml="page.html", properties={
    1.16 - *   {@link Property @Property}(name = "people", type=Person.class, array=true)
    1.17 - * })
    1.18 - * class MyModelImpl {
    1.19 - *   {@link Model @Model}(className="Person", properties={
    1.20 - *     {@link Property @Property}(name = "firstName", type=String.class),
    1.21 - *     {@link Property @Property}(name = "lastName", type=String.class)
    1.22 - *   })
    1.23 - *   static class PersonImpl {
    1.24 - *     {@link ComputedProperty @ComputedProperty}
    1.25 - *     static String fullName(String firstName, String lastName) {
    1.26 - *       return firstName + " " + lastName;
    1.27 - *     }
    1.28 - *   }
    1.29 - * 
    1.30 - *   {@link OnReceive @OnReceive}(url = "{protocol}://your.server.com/person/{name}")
    1.31 - *   static void getANewPerson(MyModel m, Person p) {
    1.32 - *     {@link Element#alert Element.alert}("Adding " + p.getFullName() + '!');
    1.33 - *     m.getPeople().add(p);
    1.34 - *   }
    1.35 - * 
    1.36 - *   // the above will generate method <code>getANewPerson</code> in class <code>MyModel</code>.
    1.37 - *   // with <code>protocol</code> and <code>name</code> arguments
    1.38 - *   // which asynchronously contacts the server and in case of success calls
    1.39 - *   // your {@link OnReceive @OnReceive} with parsed in data
    1.40 - * 
    1.41 - *   {@link On @On}(event={@link OnEvent#CLICK OnEvent.CLICK}, id="rqst")
    1.42 - *   static void requestSmith(MyModel m) {
    1.43 - *     m.getANewPerson("http", "Smith");
    1.44 - *   }
    1.45 - * }
    1.46 - * </pre>
    1.47 - * When the server returns <code>{ "firstName" : "John", "lastName" : "Smith" }</code>
    1.48 - * the browser will show alert message <em>Adding John Smith!</em>.
    1.49 - * 
    1.50 +/** 
    1.51 + * @deprecated Replaced by new {@link net.java.html.json.OnReceive net.java.html.json} API.
    1.52   * @author Jaroslav Tulach <jtulach@netbeans.org>
    1.53   * @since 0.6
    1.54   */
    1.55  @Retention(RetentionPolicy.SOURCE)
    1.56  @Target(ElementType.METHOD)
    1.57 +@Deprecated
    1.58  public @interface OnReceive {
    1.59      /** The URL to connect to. Can contain variable names surrounded by '{' and '}'.
    1.60       * Those parameters will then become variables of the associated method.