author | Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
Fri, 12 Apr 2013 15:59:24 +0200 | |
branch | fx |
changeset 973 | 44cd2b184dd1 |
parent 772 | d382dacfd73f |
child 1787 | ea12a3bb4b33 |
permissions | -rw-r--r-- |
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@793 | 25 |
/** Influence the inheritance of your class when converted to JavaScript. |
jaroslav@793 | 26 |
* Sometimes one does not want |
jaroslav@793 | 27 |
* to mimic the Java hierarchy, but modify it a bit. For example it makes |
jaroslav@793 | 28 |
* sense to treat every (JavaScript) string literal as {@link String}. |
jaroslav@793 | 29 |
* One can do it by making {@link String} subclass JavaScript <code>String</code> |
jaroslav@793 | 30 |
* and use <code>String.prototype</code> as a container for all {@link String} |
jaroslav@793 | 31 |
* methods. |
jaroslav@793 | 32 |
* |
jaroslav@239 | 33 |
* @author Jaroslav Tulach <jtulach@netbeans.org> |
jaroslav@239 | 34 |
*/ |
jaroslav@239 | 35 |
@Retention(RetentionPolicy.CLASS) |
jaroslav@239 | 36 |
@Target({ ElementType.TYPE }) |
jaroslav@239 | 37 |
public @interface JavaScriptPrototype { |
jaroslav@239 | 38 |
/** Expression that identifies the function where all methods |
jaroslav@316 | 39 |
* should be added into. If this attribute is unspecified |
jaroslav@316 | 40 |
* all methods are added to the same object specified by |
jaroslav@316 | 41 |
* {@link #prototype()}. |
jaroslav@316 | 42 |
* |
jaroslav@239 | 43 |
* @return name of function to contain methods found in given class |
jaroslav@239 | 44 |
*/ |
jaroslav@316 | 45 |
String container() default ""; |
jaroslav@239 | 46 |
/** Expression that defines the way to construct prototype for this |
jaroslav@239 | 47 |
* class. |
jaroslav@239 | 48 |
* @return expression to construct prototype |
jaroslav@239 | 49 |
*/ |
jaroslav@239 | 50 |
String prototype(); |
jaroslav@239 | 51 |
} |