jaroslav@239: /** jaroslav@239: * Back 2 Browser Bytecode Translator jaroslav@239: * Copyright (C) 2012 Jaroslav Tulach jaroslav@239: * jaroslav@239: * This program is free software: you can redistribute it and/or modify jaroslav@239: * it under the terms of the GNU General Public License as published by jaroslav@239: * the Free Software Foundation, version 2 of the License. jaroslav@239: * jaroslav@239: * This program is distributed in the hope that it will be useful, jaroslav@239: * but WITHOUT ANY WARRANTY; without even the implied warranty of jaroslav@239: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jaroslav@239: * GNU General Public License for more details. jaroslav@239: * jaroslav@239: * You should have received a copy of the GNU General Public License jaroslav@239: * along with this program. Look for COPYING file in the top folder. jaroslav@239: * If not, see http://opensource.org/licenses/GPL-2.0. jaroslav@239: */ jaroslav@239: package org.apidesign.bck2brwsr.core; jaroslav@239: jaroslav@239: import java.lang.annotation.ElementType; jaroslav@239: import java.lang.annotation.Retention; jaroslav@239: import java.lang.annotation.RetentionPolicy; jaroslav@239: import java.lang.annotation.Target; jaroslav@239: jaroslav@793: /** Influence the inheritance of your class when converted to JavaScript. jaroslav@793: * Sometimes one does not want jaroslav@793: * to mimic the Java hierarchy, but modify it a bit. For example it makes jaroslav@793: * sense to treat every (JavaScript) string literal as {@link String}. jaroslav@793: * One can do it by making {@link String} subclass JavaScript String jaroslav@793: * and use String.prototype as a container for all {@link String} jaroslav@793: * methods. jaroslav@793: * jaroslav@239: * @author Jaroslav Tulach jaroslav@239: */ jaroslav@239: @Retention(RetentionPolicy.CLASS) jaroslav@239: @Target({ ElementType.TYPE }) jaroslav@239: public @interface JavaScriptPrototype { jaroslav@239: /** Expression that identifies the function where all methods jaroslav@316: * should be added into. If this attribute is unspecified jaroslav@316: * all methods are added to the same object specified by jaroslav@316: * {@link #prototype()}. jaroslav@316: * jaroslav@239: * @return name of function to contain methods found in given class jaroslav@239: */ jaroslav@316: String container() default ""; jaroslav@239: /** Expression that defines the way to construct prototype for this jaroslav@239: * class. jaroslav@239: * @return expression to construct prototype jaroslav@239: */ jaroslav@239: String prototype(); jaroslav@239: }