core/src/main/java/org/apidesign/bck2brwsr/core/JavaScriptBody.java
branchemul
changeset 94 19497b4312bb
child 106 346633cd13d6
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/core/src/main/java/org/apidesign/bck2brwsr/core/JavaScriptBody.java	Tue Oct 09 11:11:58 2012 -0700
     1.3 @@ -0,0 +1,38 @@
     1.4 +/*
     1.5 + * To change this template, choose Tools | Templates
     1.6 + * and open the template in the editor.
     1.7 + */
     1.8 +package org.apidesign.bck2brwsr.core;
     1.9 +
    1.10 +import java.lang.annotation.ElementType;
    1.11 +import java.lang.annotation.Retention;
    1.12 +import java.lang.annotation.RetentionPolicy;
    1.13 +import java.lang.annotation.Target;
    1.14 +
    1.15 +/** Put this method on a method in case it should have a special
    1.16 + * body in the <em>JavaScript</em>.
    1.17 + *
    1.18 + * @author Jaroslav Tulach <jtulach@netbeans.org>
    1.19 + */
    1.20 +@Retention(RetentionPolicy.CLASS)
    1.21 +@Target({ ElementType.METHOD, ElementType.CONSTRUCTOR })
    1.22 +public @interface JavaScriptBody {
    1.23 +    /** Names of parameters for the method. 
    1.24 +     * 
    1.25 +     * <!--
    1.26 +     * If not specified
    1.27 +     * it will be <code>arg0, arg1, arg2</code>. In case of
    1.28 +     * instance methods, the <code>arg0</code> is reference
    1.29 +     * to <code>this</code>.
    1.30 +     * -->
    1.31 +     * 
    1.32 +     * @return array of the names of parameters for the method
    1.33 +     *    in JavaScript
    1.34 +     */
    1.35 +    public String[] args();
    1.36 +    
    1.37 +    /** The actual body of the method in JavaScript. This string will be
    1.38 +     * put into generated header (ends with '{') and footer (ends with '}').
    1.39 +     */
    1.40 +    public String body();
    1.41 +}