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