core/src/main/java/org/apidesign/bck2brwsr/core/JavaScriptPrototype.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 13 Dec 2012 23:20:47 +0100
changeset 316 8da329789435
parent 239 8ceee38f5840
permissions -rw-r--r--
Providing JavaScript specific implementations of Hashtable and Vector. Those should likely be faster for the JavaScript VM than interpreting bytecode. This is the way to get the best of JavaScript and yet provide reasonably well working implementation in Java.
jaroslav@239
     1
/**
jaroslav@239
     2
 * Back 2 Browser Bytecode Translator
jaroslav@239
     3
 * Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jaroslav@239
     4
 *
jaroslav@239
     5
 * This program is free software: you can redistribute it and/or modify
jaroslav@239
     6
 * it under the terms of the GNU General Public License as published by
jaroslav@239
     7
 * the Free Software Foundation, version 2 of the License.
jaroslav@239
     8
 *
jaroslav@239
     9
 * This program is distributed in the hope that it will be useful,
jaroslav@239
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jaroslav@239
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
jaroslav@239
    12
 * GNU General Public License for more details.
jaroslav@239
    13
 *
jaroslav@239
    14
 * You should have received a copy of the GNU General Public License
jaroslav@239
    15
 * along with this program. Look for COPYING file in the top folder.
jaroslav@239
    16
 * If not, see http://opensource.org/licenses/GPL-2.0.
jaroslav@239
    17
 */
jaroslav@239
    18
package org.apidesign.bck2brwsr.core;
jaroslav@239
    19
jaroslav@239
    20
import java.lang.annotation.ElementType;
jaroslav@239
    21
import java.lang.annotation.Retention;
jaroslav@239
    22
import java.lang.annotation.RetentionPolicy;
jaroslav@239
    23
import java.lang.annotation.Target;
jaroslav@239
    24
jaroslav@239
    25
/** Controls how JavaScript inheritance should be handled.
jaroslav@239
    26
 * @author Jaroslav Tulach <jtulach@netbeans.org>
jaroslav@239
    27
 */
jaroslav@239
    28
@Retention(RetentionPolicy.CLASS)
jaroslav@239
    29
@Target({ ElementType.TYPE })
jaroslav@239
    30
public @interface JavaScriptPrototype {
jaroslav@239
    31
    /** Expression that identifies the function where all methods
jaroslav@316
    32
     * should be added into. If this attribute is unspecified
jaroslav@316
    33
     * all methods are added to the same object specified by
jaroslav@316
    34
     * {@link #prototype()}.
jaroslav@316
    35
     * 
jaroslav@239
    36
     * @return name of function to contain methods found in given class
jaroslav@239
    37
     */
jaroslav@316
    38
    String container() default "";
jaroslav@239
    39
    /** Expression that defines the way to construct prototype for this
jaroslav@239
    40
     * class.
jaroslav@239
    41
     * @return expression to construct prototype
jaroslav@239
    42
     */
jaroslav@239
    43
    String prototype();
jaroslav@239
    44
}