Path: blob/master/test/hotspot/jtreg/vmTestbase/vm/share/options/Factory.java
41155 views
/*1* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/22package vm.share.options;23import java.lang.annotation.*;24/**25* This annotation is coupled with {@link BasicObjectFactory} class,26* and allows one to create implementations of ObjectFactory via annotations.27* <pre> a simple example:28@Factory(description="dummy factory", default_value="array_list", placeholder_text="a type",29classlist={30@FClass(description="a linked list", key="linked_list", type=LinkedList.class),31@FClass(description="an array list", key="array_list", type=ArrayList.class)32})33public class BasicObjectFactoryUsageExample extends BasicObjectFactory<Collection>34{35}36* </pre>37* @see BasicObjectFactory38* @see FClass39* @see vm.share.options.test.BasicObjectFactoryUsageExample40*/41@Retention(RetentionPolicy.RUNTIME)42@Target(ElementType.TYPE)43public @interface Factory44{45final public static String defDefaultValue = "[no factory default]";46final public static String defDescription = "[no factory description]";47/**48* Used for generating placeholder text in <..> part of help message,49* is mandatory.50*/51String placeholder_text(); // mandatory ;52/**53* Default value, used if the option is not specified AND if no default54* value has been specified in the corresponding @Option annotation.55*/56String default_value() default defDefaultValue;5758/**59* A help message string for the factory.60*/61String description() default defDescription;6263/**64* The list of classes and keys to instantiate.65* @see FClass66*/67FClass[] classlist(); // mandatory68}697071