├── sample
├── .gitignore
├── src
│ └── main
│ │ ├── res
│ │ ├── drawable-hdpi
│ │ │ └── ic_launcher.png
│ │ ├── drawable-mdpi
│ │ │ └── ic_launcher.png
│ │ ├── drawable-xhdpi
│ │ │ └── ic_launcher.png
│ │ ├── drawable-xxhdpi
│ │ │ └── ic_launcher.png
│ │ ├── values-v21
│ │ │ └── styles.xml
│ │ ├── values
│ │ │ ├── dimens.xml
│ │ │ ├── styles.xml
│ │ │ └── strings.xml
│ │ ├── values-w820dp
│ │ │ └── dimens.xml
│ │ └── layout
│ │ │ └── activity_main.xml
│ │ ├── java
│ │ └── me
│ │ │ └── denley
│ │ │ └── preferencebinder
│ │ │ └── sample
│ │ │ ├── PreferenceDefaults.java
│ │ │ ├── FragmentSampleActivity.java
│ │ │ ├── MainActivity.java
│ │ │ └── SampleFragment.java
│ │ └── AndroidManifest.xml
├── proguard-rules.pro
└── build.gradle
├── library
├── .gitignore
├── src
│ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── resources
│ │ └── META-INF
│ │ │ └── services
│ │ │ └── javax.annotation.processing.Processor
│ │ └── java
│ │ ├── me
│ │ └── denley
│ │ │ └── preferencebinder
│ │ │ ├── PreferenceDefault.java
│ │ │ ├── BindPref.java
│ │ │ └── internal
│ │ │ ├── PrefType.java
│ │ │ ├── Binding.java
│ │ │ ├── PrefBinding.java
│ │ │ └── WidgetBindingType.java
│ │ └── javax
│ │ ├── lang
│ │ └── model
│ │ │ ├── type
│ │ │ ├── NullType.java
│ │ │ ├── ReferenceType.java
│ │ │ ├── PrimitiveType.java
│ │ │ ├── ArrayType.java
│ │ │ ├── ErrorType.java
│ │ │ ├── UnionType.java
│ │ │ ├── package-info.java
│ │ │ ├── NoType.java
│ │ │ ├── IntersectionType.java
│ │ │ ├── WildcardType.java
│ │ │ ├── MirroredTypeException.java
│ │ │ ├── UnknownTypeException.java
│ │ │ ├── TypeVariable.java
│ │ │ ├── DeclaredType.java
│ │ │ ├── MirroredTypesException.java
│ │ │ ├── ExecutableType.java
│ │ │ ├── TypeKind.java
│ │ │ └── TypeMirror.java
│ │ │ ├── element
│ │ │ ├── QualifiedNameable.java
│ │ │ ├── Parameterizable.java
│ │ │ ├── AnnotationValue.java
│ │ │ ├── TypeParameterElement.java
│ │ │ ├── AnnotationMirror.java
│ │ │ ├── Modifier.java
│ │ │ ├── UnknownElementException.java
│ │ │ ├── PackageElement.java
│ │ │ ├── UnknownAnnotationValueException.java
│ │ │ ├── VariableElement.java
│ │ │ ├── Name.java
│ │ │ ├── NestingKind.java
│ │ │ ├── ElementKind.java
│ │ │ └── package-info.java
│ │ │ ├── util
│ │ │ ├── package-info.java
│ │ │ ├── AbstractAnnotationValueVisitor7.java
│ │ │ ├── AbstractAnnotationValueVisitor8.java
│ │ │ ├── AbstractElementVisitor7.java
│ │ │ ├── AbstractElementVisitor8.java
│ │ │ ├── AbstractTypeVisitor7.java
│ │ │ ├── AbstractTypeVisitor8.java
│ │ │ ├── SimpleAnnotationValueVisitor7.java
│ │ │ ├── SimpleAnnotationValueVisitor8.java
│ │ │ ├── SimpleElementVisitor8.java
│ │ │ ├── ElementKindVisitor8.java
│ │ │ ├── SimpleElementVisitor7.java
│ │ │ ├── SimpleTypeVisitor7.java
│ │ │ ├── SimpleTypeVisitor8.java
│ │ │ ├── AbstractAnnotationValueVisitor6.java
│ │ │ ├── ElementScanner8.java
│ │ │ ├── TypeKindVisitor7.java
│ │ │ └── TypeKindVisitor8.java
│ │ │ ├── UnknownEntityException.java
│ │ │ └── package-info.java
│ │ ├── tools
│ │ ├── OptionChecker.java
│ │ ├── DiagnosticListener.java
│ │ ├── DiagnosticCollector.java
│ │ ├── ForwardingJavaFileObject.java
│ │ ├── Tool.java
│ │ ├── package-info.java
│ │ ├── StandardLocation.java
│ │ ├── ForwardingFileObject.java
│ │ └── JavaFileObject.java
│ │ └── annotation
│ │ ├── Resources.java
│ │ ├── processing
│ │ ├── package-info.java
│ │ ├── Completion.java
│ │ ├── SupportedOptions.java
│ │ ├── SupportedSourceVersion.java
│ │ ├── FilerException.java
│ │ ├── SupportedAnnotationTypes.java
│ │ ├── Completions.java
│ │ ├── Messager.java
│ │ └── RoundEnvironment.java
│ │ ├── Generated.java
│ │ ├── PreDestroy.java
│ │ └── PostConstruct.java
├── build.gradle
├── proguard-rules.pro
└── android-release-aar.gradle
├── settings.gradle
├── .gitignore
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew.bat
└── CHANGELOG.md
/sample/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/library/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':sample', ':library'
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea
4 | *.iml
5 | .DS_Store
6 | /build
7 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/denley/preferencebinder/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/library/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
Unless otherwise specified in a particular implementation, the 30 | * collections returned by methods in this package should be expected 31 | * to be unmodifiable by the caller and unsafe for concurrent access. 32 | * 33 | *
Unless otherwise specified, methods in this package will throw 34 | * a {@code NullPointerException} if given a {@code null} argument. 35 | * 36 | * @author Joseph D. Darcy 37 | * @author Scott Seligman 38 | * @author Peter von der Ahé 39 | * @since 1.6 40 | */ 41 | package javax.lang.model.type; 42 | -------------------------------------------------------------------------------- /library/src/main/java/javax/lang/model/util/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 4 | * 5 | * 6 | * 7 | * 8 | * 9 | * 10 | * 11 | * 12 | * 13 | * 14 | * 15 | * 16 | * 17 | * 18 | * 19 | * 20 | * 21 | * 22 | * 23 | * 24 | */ 25 | 26 | /** 27 | * Utilities to assist in the processing of 28 | * {@linkplain javax.lang.model.element program elements} and 29 | * {@linkplain javax.lang.model.type types}. 30 | * 31 | *
Unless otherwise specified in a particular implementation, the 32 | * collections returned by methods in this package should be expected 33 | * to be unmodifiable by the caller and unsafe for concurrent access. 34 | * 35 | *
Unless otherwise specified, methods in this package will throw 36 | * a {@code NullPointerException} if given a {@code null} argument. 37 | * 38 | * @author Joseph D. Darcy 39 | * @author Scott Seligman 40 | * @author Peter von der Ahé 41 | * @since 1.6 42 | */ 43 | package javax.lang.model.util; 44 | -------------------------------------------------------------------------------- /library/src/main/java/javax/annotation/processing/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 4 | * 5 | * 6 | * 7 | * 8 | * 9 | * 10 | * 11 | * 12 | * 13 | * 14 | * 15 | * 16 | * 17 | * 18 | * 19 | * 20 | * 21 | * 22 | * 23 | * 24 | */ 25 | 26 | /** 27 | * Facilities for declaring annotation processors and for 28 | * allowing annotation processors to communicate with an annotation processing 29 | * tool environment. 30 | * 31 | *
Unless otherwise specified in a particular implementation, the 32 | * collections returned by methods in this package should be expected 33 | * to be unmodifiable by the caller and unsafe for concurrent access. 34 | * 35 | *
Unless otherwise specified, methods in this package will throw
36 | * a {@code NullPointerException} if given a {@code null} argument.
37 | *
38 | * @author Joseph D. Darcy
39 | * @author Scott Seligman
40 | * @author Peter von der Ahé
41 | * @since 1.6
42 | */
43 | package javax.annotation.processing;
44 |
--------------------------------------------------------------------------------
/library/src/main/java/me/denley/preferencebinder/BindPref.java:
--------------------------------------------------------------------------------
1 | package me.denley.preferencebinder;
2 |
3 | import java.lang.annotation.Retention;
4 | import java.lang.annotation.Target;
5 |
6 | import me.denley.preferencebinder.internal.WidgetBindingType;
7 |
8 | import static java.lang.annotation.ElementType.FIELD;
9 | import static java.lang.annotation.ElementType.METHOD;
10 | import static java.lang.annotation.RetentionPolicy.CLASS;
11 |
12 | /**
13 | * Bind a field to the preference value with the specified key.
14 | */
15 | @Retention(CLASS) @Target({FIELD, METHOD})
16 | public @interface BindPref {
17 |
18 | /** SharedPreferences key for the preference value to be found */
19 | String[] value();
20 |
21 | /** Whether or not to initialize this field/method when binding occurs */
22 | boolean init() default true;
23 |
24 | /** Whether or not to update this field or call this method again when the preference value changes */
25 | boolean listen() default true;
26 |
27 | /** The method to use to bind to a widget */
28 | WidgetBindingType bindTo() default WidgetBindingType.ASSIGN;
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/tools/DiagnosticListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.tools;
27 |
28 | /**
29 | * Interface for receiving diagnostics from tools.
30 | *
31 | * @param An intersection type can be either implicitly or explicitly
34 | * declared in a program. For example, the bound of the type parameter
35 | * {@code A wildcard may have its upper bound explicitly set by an
38 | * {@code extends} clause, its lower bound explicitly set by a
39 | * {@code super} clause, or neither (but not both).
40 | *
41 | * @author Joseph D. Darcy
42 | * @author Scott Seligman
43 | * @author Peter von der Ahé
44 | * @since 1.6
45 | */
46 | public interface WildcardType extends TypeMirror {
47 |
48 | /**
49 | * Returns the upper bound of this wildcard.
50 | * If no upper bound is explicitly declared,
51 | * {@code null} is returned.
52 | *
53 | * @return the upper bound of this wildcard
54 | */
55 | TypeMirror getExtendsBound();
56 |
57 | /**
58 | * Returns the lower bound of this wildcard.
59 | * If no lower bound is explicitly declared,
60 | * {@code null} is returned.
61 | *
62 | * @return the lower bound of this wildcard
63 | */
64 | TypeMirror getSuperBound();
65 | }
66 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/lang/model/UnknownEntityException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.lang.model;
27 |
28 | /**
29 | * Superclass of exceptions which indicate that an unknown kind of
30 | * entity was encountered. This situation can occur if the language
31 | * evolves and new kinds of constructs are introduced. Subclasses of
32 | * this exception may be thrown by visitors to indicate that the
33 | * visitor was created for a prior version of the language.
34 | *
35 | * A common superclass for those exceptions allows a single catch
36 | * block to have code handling them uniformly.
37 | *
38 | * @author Joseph D. Darcy
39 | * @see javax.lang.model.element.UnknownElementException
40 | * @see javax.lang.model.element.UnknownAnnotationValueException
41 | * @see javax.lang.model.type.UnknownTypeException
42 | * @since 1.7
43 | */
44 | public class UnknownEntityException extends RuntimeException {
45 |
46 | private static final long serialVersionUID = 269L;
47 |
48 | /**
49 | * Creates a new {@code UnknownEntityException} with the specified
50 | * detail message.
51 | *
52 | * @param message the detail message
53 | */
54 | protected UnknownEntityException(String message) {
55 | super(message);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/tools/ForwardingJavaFileObject.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.tools;
27 |
28 | import javax.lang.model.element.Modifier;
29 | import javax.lang.model.element.NestingKind;
30 |
31 | /**
32 | * Forwards calls to a given file object. Subclasses of this class
33 | * might override some of these methods and might also provide
34 | * additional fields and methods.
35 | *
36 | * @param This language model follows a mirror-based design; see
36 | *
37 | * Unless otherwise specified, methods in this package will throw
52 | * a {@code NullPointerException} if given a {@code null} argument.
53 | *
54 | * @author Joseph D. Darcy
55 | * @author Scott Seligman
56 | * @author Peter von der Ahé
57 | * @since 1.6
58 | */
59 |
60 | package javax.lang.model;
61 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/lang/model/element/AnnotationValue.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.lang.model.element;
27 |
28 | /**
29 | * Represents a value of an annotation type element.
30 | * A value is of one of the following types:
31 | * the type of the additional parameter to the visitor's methods
68 | * @param v the visitor operating on this value
69 | * @param p additional parameter to the visitor
70 | * @return a visitor-specified result
71 | */
72 | Tools can be located using {@link
40 | * java.util.ServiceLoader#load(Class)}.
41 | *
42 | * @author Neal M Gafter
43 | * @author Peter von der Ahé
44 | * @author Jonathan Gibbons
45 | * @since 1.6
46 | */
47 | public interface Tool {
48 |
49 | /**
50 | * Run the tool with the given I/O channels and arguments. By
51 | * convention a tool returns 0 for success and nonzero for errors.
52 | * Any diagnostics generated will be written to either {@code out}
53 | * or {@code err} in some unspecified format.
54 | *
55 | * @param in "standard" input; use System.in if null
56 | * @param out "standard" output; use System.out if null
57 | * @param err "standard" error; use System.err if null
58 | * @param arguments arguments to pass to the tool
59 | * @return 0 for success; nonzero otherwise
60 | * @throws NullPointerException if the array of arguments contains
61 | * any {@code null} elements.
62 | */
63 | int run(InputStream in, OutputStream out, OutputStream err, String... arguments);
64 |
65 | /**
66 | * Gets the source versions of the Java™ programming language
67 | * supported by this tool.
68 | * @return a set of supported source versions
69 | */
70 | Set Annotations should be compared using the {@code equals}
36 | * method. There is no guarantee that any particular annotation will
37 | * always be represented by the same object.
38 | *
39 | * @author Joseph D. Darcy
40 | * @author Scott Seligman
41 | * @author Peter von der Ahé
42 | * @since 1.6
43 | */
44 | public interface AnnotationMirror {
45 |
46 | /**
47 | * Returns the type of this annotation.
48 | *
49 | * @return the type of this annotation
50 | */
51 | DeclaredType getAnnotationType();
52 |
53 | /**
54 | * Returns the values of this annotation's elements.
55 | * This is returned in the form of a map that associates elements
56 | * with their corresponding values.
57 | * Only those elements with values explicitly present in the
58 | * annotation are included, not those that are implicitly assuming
59 | * their default values.
60 | * The order of the map matches the order in which the
61 | * values appear in the annotation's source.
62 | *
63 | * Note that an annotation mirror of a marker annotation type
64 | * will by definition have an empty map.
65 | *
66 | * To fill in default values, use {@link
67 | * javax.lang.model.util.Elements#getElementValuesWithDefaults
68 | * getElementValuesWithDefaults}.
69 | *
70 | * @return the values of this annotation's elements,
71 | * or an empty map if there are none
72 | */
73 | Map extends ExecutableElement, ? extends AnnotationValue> getElementValues();
74 | }
75 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/lang/model/element/Modifier.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.lang.model.element;
27 |
28 |
29 | /**
30 | * Represents a modifier on a program element such
31 | * as a class, method, or field.
32 | *
33 | * Not all modifiers are applicable to all kinds of elements.
34 | * When two or more modifiers appear in the source code of an element
35 | * then it is customary, though not required, that they appear in the same
36 | * order as the constants listed in the detail section below.
37 | *
38 | * Note that it is possible additional modifiers will be added in
39 | * future versions of the platform.
40 | *
41 | * @author Joseph D. Darcy
42 | * @author Scott Seligman
43 | * @author Peter von der Ahé
44 | * @since 1.6
45 | */
46 |
47 | public enum Modifier {
48 |
49 | // See JLS sections 8.1.1, 8.3.1, 8.4.3, 8.8.3, and 9.1.1.
50 | // java.lang.reflect.Modifier includes INTERFACE, but that's a VMism.
51 |
52 | /** The modifier {@code public} */ PUBLIC,
53 | /** The modifier {@code protected} */ PROTECTED,
54 | /** The modifier {@code private} */ PRIVATE,
55 | /** The modifier {@code abstract} */ ABSTRACT,
56 | /**
57 | * The modifier {@code default}
58 | * @since 1.8
59 | */
60 | DEFAULT,
61 | /** The modifier {@code static} */ STATIC,
62 | /** The modifier {@code final} */ FINAL,
63 | /** The modifier {@code transient} */ TRANSIENT,
64 | /** The modifier {@code volatile} */ VOLATILE,
65 | /** The modifier {@code synchronized} */ SYNCHRONIZED,
66 | /** The modifier {@code native} */ NATIVE,
67 | /** The modifier {@code strictfp} */ STRICTFP;
68 |
69 | /**
70 | * Returns this modifier's name in lowercase.
71 | */
72 | public String toString() {
73 | return name().toLowerCase(java.util.Locale.US);
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/annotation/Generated.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.annotation;
27 | import java.lang.annotation.*;
28 | import static java.lang.annotation.ElementType.*;
29 | import static java.lang.annotation.RetentionPolicy.*;
30 |
31 | /**
32 | * The Generated annotation is used to mark source code that has been generated.
33 | * It can also be used to differentiate user written code from generated code
34 | * in a single file. When used, the value element must have the name of the
35 | * code generator. The recommended convention is to use the fully qualified
36 | * name of the code generator in the value field .
37 | * For example: com.company.package.classname.
38 | * The date element is used to indicate the date the source was generated.
39 | * The date element must follow the ISO 8601 standard. For example the date
40 | * element would have the following value 2001-07-04T12:08:56.235-0700
41 | * which represents 2001-07-04 12:08:56 local time in the U.S. Pacific
42 | * Time time zone. The comment element is a place holder for any comments that the code
44 | * generator may want to include in the generated code. If this type variable was declared with no explicit
63 | * upper bounds, the result is {@code java.lang.Object}.
64 | * If it was declared with multiple upper bounds,
65 | * the result is an {@linkplain IntersectionType intersection type};
66 | * individual bounds can be found by examining the result's
67 | * {@linkplain IntersectionType#getBounds() bounds}.
68 | *
69 | * @return the upper bound of this type variable
70 | */
71 | TypeMirror getUpperBound();
72 |
73 | /**
74 | * Returns the lower bound of this type variable. While a type
75 | * parameter cannot include an explicit lower bound declaration,
76 | * capture conversion can produce a type variable with a
77 | * non-trivial lower bound. Type variables otherwise have a
78 | * lower bound of {@link NullType}.
79 | *
80 | * @return the lower bound of this type variable
81 | */
82 | TypeMirror getLowerBound();
83 | }
84 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/lang/model/element/UnknownElementException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.lang.model.element;
27 |
28 | import javax.lang.model.UnknownEntityException;
29 |
30 | /**
31 | * Indicates that an unknown kind of element was encountered. This
32 | * can occur if the language evolves and new kinds of elements are
33 | * added to the {@code Element} hierarchy. May be thrown by an
34 | * {@linkplain ElementVisitor element visitor} to indicate that the
35 | * visitor was created for a prior version of the language.
36 | *
37 | * @author Joseph D. Darcy
38 | * @author Scott Seligman
39 | * @author Peter von der Ahé
40 | * @see ElementVisitor#visitUnknown
41 | * @since 1.6
42 | */
43 | public class UnknownElementException extends UnknownEntityException {
44 |
45 | private static final long serialVersionUID = 269L;
46 |
47 | private transient Element element;
48 | private transient Object parameter;
49 |
50 | /**
51 | * Creates a new {@code UnknownElementException}. The {@code p}
52 | * parameter may be used to pass in an additional argument with
53 | * information about the context in which the unknown element was
54 | * encountered; for example, the visit methods of {@link
55 | * ElementVisitor} may pass in their additional parameter.
56 | *
57 | * @param e the unknown element, may be {@code null}
58 | * @param p an additional parameter, may be {@code null}
59 | */
60 | public UnknownElementException(Element e, Object p) {
61 | super("Unknown element: " + e);
62 | element = e;
63 | this.parameter = p;
64 | }
65 |
66 | /**
67 | * Returns the unknown element.
68 | * The value may be unavailable if this exception has been
69 | * serialized and then read back in.
70 | *
71 | * @return the unknown element, or {@code null} if unavailable
72 | */
73 | public Element getUnknownElement() {
74 | return element;
75 | }
76 |
77 | /**
78 | * Returns the additional argument.
79 | *
80 | * @return the additional argument
81 | */
82 | public Object getArgument() {
83 | return parameter;
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/lang/model/element/PackageElement.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.lang.model.element;
27 |
28 | import java.util.List;
29 |
30 | /**
31 | * Represents a package program element. Provides access to information
32 | * about the package and its members.
33 | *
34 | * @author Joseph D. Darcy
35 | * @author Scott Seligman
36 | * @author Peter von der Ahé
37 | * @see javax.lang.model.util.Elements#getPackageOf
38 | * @since 1.6
39 | */
40 | public interface PackageElement extends Element, QualifiedNameable {
41 |
42 | /**
43 | * Returns the fully qualified name of this package.
44 | * This is also known as the package's canonical name.
45 | *
46 | * @return the fully qualified name of this package, or an
47 | * empty name if this is an unnamed package
48 | * @jls 6.7 Fully Qualified Names and Canonical Names
49 | */
50 | Name getQualifiedName();
51 |
52 | /**
53 | * Returns the simple name of this package. For an unnamed
54 | * package, an empty name is returned.
55 | *
56 | * @return the simple name of this package or an empty name if
57 | * this is an unnamed package
58 | */
59 | @Override
60 | Name getSimpleName();
61 |
62 | /**
63 | * Returns the {@linkplain NestingKind#TOP_LEVEL top-level}
64 | * classes and interfaces within this package. Note that
65 | * subpackages are not considered to be enclosed by a
66 | * package.
67 | *
68 | * @return the top-level classes and interfaces within this
69 | * package
70 | */
71 | @Override
72 | List extends Element> getEnclosedElements();
73 |
74 | /**
75 | * Returns {@code true} is this is an unnamed package and {@code
76 | * false} otherwise.
77 | *
78 | * @return {@code true} is this is an unnamed package and {@code
79 | * false} otherwise
80 | * @jls 7.4.2 Unnamed Packages
81 | */
82 | boolean isUnnamed();
83 |
84 | /**
85 | * Returns {@code null} since a package is not enclosed by another
86 | * element.
87 | *
88 | * @return {@code null}
89 | */
90 | @Override
91 | Element getEnclosingElement();
92 | }
93 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/lang/model/element/UnknownAnnotationValueException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.lang.model.element;
27 |
28 | import javax.lang.model.UnknownEntityException;
29 |
30 | /**
31 | * Indicates that an unknown kind of annotation value was encountered.
32 | * This can occur if the language evolves and new kinds of annotation
33 | * values can be stored in an annotation. May be thrown by an
34 | * {@linkplain AnnotationValueVisitor annotation value visitor} to
35 | * indicate that the visitor was created for a prior version of the
36 | * language.
37 | *
38 | * @author Joseph D. Darcy
39 | * @author Scott Seligman
40 | * @author Peter von der Ahé
41 | * @see AnnotationValueVisitor#visitUnknown
42 | * @since 1.6
43 | */
44 | public class UnknownAnnotationValueException extends UnknownEntityException {
45 |
46 | private static final long serialVersionUID = 269L;
47 |
48 | private transient AnnotationValue av;
49 | private transient Object parameter;
50 |
51 | /**
52 | * Creates a new {@code UnknownAnnotationValueException}. The
53 | * {@code p} parameter may be used to pass in an additional
54 | * argument with information about the context in which the
55 | * unknown annotation value was encountered; for example, the
56 | * visit methods of {@link AnnotationValueVisitor} may pass in
57 | * their additional parameter.
58 | *
59 | * @param av the unknown annotation value, may be {@code null}
60 | * @param p an additional parameter, may be {@code null}
61 | */
62 | public UnknownAnnotationValueException(AnnotationValue av, Object p) {
63 | super("Unknown annotation value: " + av);
64 | this.av = av;
65 | this.parameter = p;
66 | }
67 |
68 | /**
69 | * Returns the unknown annotation value.
70 | * The value may be unavailable if this exception has been
71 | * serialized and then read back in.
72 | *
73 | * @return the unknown element, or {@code null} if unavailable
74 | */
75 | public AnnotationValue getUnknownAnnotationValue() {
76 | return av;
77 | }
78 |
79 | /**
80 | * Returns the additional argument.
81 | *
82 | * @return the additional argument
83 | */
84 | public Object getArgument() {
85 | return parameter;
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/lang/model/type/DeclaredType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.lang.model.type;
27 |
28 |
29 | import java.util.List;
30 |
31 | import javax.lang.model.element.Element;
32 | import javax.lang.model.element.TypeElement;
33 | import javax.lang.model.util.Types;
34 |
35 |
36 | /**
37 | * Represents a declared type, either a class type or an interface type.
38 | * This includes parameterized types such as {@code java.util.Set While a {@code TypeElement} represents a class or interface
42 | * element, a {@code DeclaredType} represents a class
43 | * or interface type, the latter being a use
44 | * (or invocation) of the former.
45 | * See {@link TypeElement} for more on this distinction.
46 | *
47 | * The supertypes (both class and interface types) of a declared
48 | * type may be found using the {@link
49 | * Types#directSupertypes(TypeMirror)} method. This returns the
50 | * supertypes with any type arguments substituted in.
51 | *
52 | * @author Joseph D. Darcy
53 | * @author Scott Seligman
54 | * @author Peter von der Ahé
55 | * @see TypeElement
56 | * @since 1.6
57 | */
58 | public interface DeclaredType extends ReferenceType {
59 |
60 | /**
61 | * Returns the element corresponding to this type.
62 | *
63 | * @return the element corresponding to this type
64 | */
65 | Element asElement();
66 |
67 | /**
68 | * Returns the type of the innermost enclosing instance or a
69 | * {@code NoType} of kind {@code NONE} if there is no enclosing
70 | * instance. Only types corresponding to inner classes have an
71 | * enclosing instance.
72 | *
73 | * @return a type mirror for the enclosing type
74 | * @jls 8.1.3 Inner Classes and Enclosing Instances
75 | * @jls 15.9.2 Determining Enclosing Instances
76 | */
77 | TypeMirror getEnclosingType();
78 |
79 | /**
80 | * Returns the actual type arguments of this type.
81 | * For a type nested within a parameterized type
82 | * (such as {@code Outer
42 | *
49 | * void <METHOD>(InvocationContext)
50 | *
51 | * Object <METHOD>(InvocationContext) throws Exception
52 | *
53 | * Note: A PreDestroy interceptor method must not throw application
54 | * exceptions, but it may be declared to throw checked exceptions including
55 | * the java.lang.Exception if the same interceptor method interposes on
56 | * business or timeout methods in addition to lifecycle events. If a
57 | * PreDestroy interceptor method returns a value, it is ignored by
58 | * the container.
59 | *
63 | * void <METHOD>()
64 | * These interfaces and classes are required as part of the
31 | * Java™ Platform, Standard Edition (Java SE),
32 | * but there is no requirement to provide any tools implementing them.
33 | *
34 | * Unless explicitly allowed, all methods in this package might
35 | * throw a {@linkplain java.lang.NullPointerException} if given a
36 | * {@code null} argument or if given a
37 | * {@linkplain java.lang.Iterable list or collection} containing
38 | * {@code null} elements. Similarly, no method may return
39 | * {@code null} unless explicitly allowed.
40 | *
41 | * This package is the home of the Java programming language compiler framework. This
42 | * framework allows clients of the framework to locate and run
43 | * compilers from programs. The framework also provides Service
44 | * Provider Interfaces (SPI) for structured access to diagnostics
45 | * ({@linkplain javax.tools.DiagnosticListener}) as well as a file
46 | * abstraction for overriding file access ({@linkplain
47 | * javax.tools.JavaFileManager} and {@linkplain
48 | * javax.tools.JavaFileObject}). See {@linkplain
49 | * javax.tools.JavaCompiler} for more details on using the SPI.
50 | *
51 | * There is no requirement for a compiler at runtime. However, if
52 | * a default compiler is provided, it can be located using the
53 | * {@linkplain javax.tools.ToolProvider}, for example:
54 | *
55 | * {@code JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();}
56 | *
57 | * It is possible to provide alternative compilers or tools
58 | * through the {@linkplain java.util.ServiceLoader service provider
59 | * mechanism}.
60 | *
61 | * For example, if {@code com.vendor.VendorJavaCompiler} is a
62 | * provider of the {@code JavaCompiler} tool then its jar file
63 | * would contain the file {@code
64 | * META-INF/services/javax.tools.JavaCompiler}. This file would
65 | * contain the single line:
66 | *
67 | * {@code com.vendor.VendorJavaCompiler}
68 | *
69 | * If the jar file is on the class path, VendorJavaCompiler can be
70 | * located using code like this:
71 | *
72 | * {@code JavaCompiler compiler = ServiceLoader.load(JavaCompiler.class).iterator().next();}
73 | *
74 | * @author Peter von der Ahé
75 | * @author Jonathan Gibbons
76 | * @since 1.6
77 | */
78 | package javax.tools;
79 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/lang/model/element/VariableElement.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.lang.model.element;
27 |
28 | import javax.lang.model.util.Elements;
29 |
30 | /**
31 | * Represents a field, {@code enum} constant, method or constructor
32 | * parameter, local variable, resource variable, or exception
33 | * parameter.
34 | *
35 | * @author Joseph D. Darcy
36 | * @author Scott Seligman
37 | * @author Peter von der Ahé
38 | * @since 1.6
39 | */
40 | public interface VariableElement extends Element {
41 |
42 | /**
43 | * Returns the value of this variable if this is a {@code final}
44 | * field initialized to a compile-time constant. Returns {@code
45 | * null} otherwise. The value will be of a primitive type or a
46 | * {@code String}. If the value is of a primitive type, it is
47 | * wrapped in the appropriate wrapper class (such as {@link
48 | * Integer}).
49 | *
50 | * Note that not all {@code final} fields will have
51 | * constant values. In particular, {@code enum} constants are
52 | * not considered to be compile-time constants. To have a
53 | * constant value, a field's type must be either a primitive type
54 | * or {@code String}.
55 | *
56 | * @return the value of this variable if this is a {@code final}
57 | * field initialized to a compile-time constant, or {@code null}
58 | * otherwise
59 | *
60 | * @see Elements#getConstantExpression(Object)
61 | * @jls 15.28 Constant Expression
62 | * @jls 4.12.4 final Variables
63 | */
64 | Object getConstantValue();
65 |
66 | /**
67 | * Returns the simple name of this variable element.
68 | *
69 | * For method and constructor parameters, the name of each
70 | * parameter must be distinct from the names of all other
71 | * parameters of the same executable. If the original source
72 | * names are not available, an implementation may synthesize names
73 | * subject to the distinctness requirement above.
74 | *
75 | * @return the simple name of this variable element
76 | */
77 | @Override
78 | Name getSimpleName();
79 |
80 | /**
81 | * Returns the enclosing element of this variable.
82 | *
83 | * The enclosing element of a method or constructor parameter is
84 | * the executable declaring the parameter.
85 | *
86 | * @return the enclosing element of this variable
87 | */
88 | @Override
89 | Element getEnclosingElement();
90 | }
91 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/annotation/PostConstruct.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.annotation;
27 |
28 | import java.lang.annotation.*;
29 | import static java.lang.annotation.ElementType.*;
30 | import static java.lang.annotation.RetentionPolicy.*;
31 |
32 | /**
33 | * The PostConstruct annotation is used on a method that needs to be executed
34 | * after dependency injection is done to perform any initialization. This
35 | * method MUST be invoked before the class is put into service. This
36 | * annotation MUST be supported on all classes that support dependency
37 | * injection. The method annotated with PostConstruct MUST be invoked even
38 | * if the class does not request any resources to be injected. Only one
39 | * method can be annotated with this annotation. The method on which the
40 | * PostConstruct annotation is applied MUST fulfill all of the following
41 | * criteria:
42 | *
43 | *
50 | * void <METHOD>(InvocationContext)
51 | *
52 | * Object <METHOD>(InvocationContext) throws Exception
53 | *
54 | * Note: A PostConstruct interceptor method must not throw application
55 | * exceptions, but it may be declared to throw checked exceptions including
56 | * the java.lang.Exception if the same interceptor method interposes on
57 | * business or timeout methods in addition to lifecycle events. If a
58 | * PostConstruct interceptor method returns a value, it is ignored by
59 | * the container.
60 | *
64 | * void <METHOD>()
65 | * WARNING: The {@code AnnotationValueVisitor} interface
38 | * implemented by this class may have methods added to it in the
39 | * future to accommodate new, currently unknown, language structures
40 | * added to future versions of the Java™ programming language.
41 | * Therefore, methods whose names begin with {@code "visit"} may be
42 | * added to this class in the future; to avoid incompatibilities,
43 | * classes which extend this class should not declare any instance
44 | * methods with names beginning with {@code "visit"}.
45 | *
46 | * When such a new visit method is added, the default
47 | * implementation in this class will be to call the {@link
48 | * #visitUnknown visitUnknown} method. A new abstract annotation
49 | * value visitor class will also be introduced to correspond to the
50 | * new language level; this visitor will have different default
51 | * behavior for the visit method in question. When the new visitor is
52 | * introduced, all or portions of this visitor may be deprecated.
53 | *
54 | * Note that adding a default implementation of a new visit method
55 | * in a visitor class will occur instead of adding a default
56 | * method directly in the visitor interface since a Java SE 8
57 | * language feature cannot be used to this version of the API since
58 | * this version is required to be runnable on Java SE 7
59 | * implementations. Future versions of the API that are only required
60 | * to run on Java SE 8 and later may take advantage of default methods
61 | * in this situation.
62 | *
63 | * @param the type of the additional parameter to this visitor's methods.
65 | *
66 | * @see AbstractAnnotationValueVisitor6
67 | * @see AbstractAnnotationValueVisitor8
68 | * @since 1.7
69 | */
70 | @SupportedSourceVersion(RELEASE_7)
71 | public abstract class AbstractAnnotationValueVisitor7 WARNING: The {@code AnnotationValueVisitor} interface
38 | * implemented by this class may have methods added to it in the
39 | * future to accommodate new, currently unknown, language structures
40 | * added to future versions of the Java™ programming language.
41 | * Therefore, methods whose names begin with {@code "visit"} may be
42 | * added to this class in the future; to avoid incompatibilities,
43 | * classes which extend this class should not declare any instance
44 | * methods with names beginning with {@code "visit"}.
45 | *
46 | * When such a new visit method is added, the default
47 | * implementation in this class will be to call the {@link
48 | * #visitUnknown visitUnknown} method. A new abstract annotation
49 | * value visitor class will also be introduced to correspond to the
50 | * new language level; this visitor will have different default
51 | * behavior for the visit method in question. When the new visitor is
52 | * introduced, all or portions of this visitor may be deprecated.
53 | *
54 | * Note that adding a default implementation of a new visit method
55 | * in a visitor class will occur instead of adding a default
56 | * method directly in the visitor interface since a Java SE 8
57 | * language feature cannot be used to this version of the API since
58 | * this version is required to be runnable on Java SE 7
59 | * implementations. Future versions of the API that are only required
60 | * to run on Java SE 8 and later may take advantage of default methods
61 | * in this situation.
62 | *
63 | * @param the type of the additional parameter to this visitor's methods.
65 | *
66 | * @see AbstractAnnotationValueVisitor6
67 | * @see AbstractAnnotationValueVisitor7
68 | * @since 1.8
69 | */
70 | @SupportedSourceVersion(RELEASE_8)
71 | public abstract class AbstractAnnotationValueVisitor8 An empty {@code Name} has a length of zero.
37 | *
38 | * In the context of {@linkplain
39 | * javax.annotation.processing.ProcessingEnvironment annotation
40 | * processing}, the guarantees for "the same" implementation must
41 | * include contexts where the {@linkplain javax.annotation.processing
42 | * API mediated} side effects of {@linkplain
43 | * javax.annotation.processing.Processor processors} could be visible
44 | * to each other, including successive annotation processing
45 | * {@linkplain javax.annotation.processing.RoundEnvironment rounds}.
46 | *
47 | * @author Joseph D. Darcy
48 | * @author Scott Seligman
49 | * @author Peter von der Ahé
50 | * @see javax.lang.model.util.Elements#getName
51 | * @since 1.6
52 | */
53 | public interface Name extends CharSequence {
54 | /**
55 | * Returns {@code true} if the argument represents the same
56 | * name as {@code this}, and {@code false} otherwise.
57 | *
58 | * Note that the identity of a {@code Name} is a function both
59 | * of its content in terms of a sequence of characters as well as
60 | * the implementation which created it.
61 | *
62 | * @param obj the object to be compared with this element
63 | * @return {@code true} if the specified object represents the same
64 | * name as this
65 | * @see Element#equals
66 | */
67 | boolean equals(Object obj);
68 |
69 | /**
70 | * Obeys the general contract of {@link Object#hashCode Object.hashCode}.
71 | *
72 | * @see #equals
73 | */
74 | int hashCode();
75 |
76 | /**
77 | * Compares this name to the specified {@code CharSequence}. The result
78 | * is {@code true} if and only if this name represents the same sequence
79 | * of {@code char} values as the specified sequence.
80 | *
81 | * @return {@code true} if this name represents the same sequence
82 | * of {@code char} values as the specified sequence, {@code false}
83 | * otherwise
84 | *
85 | * @param cs The sequence to compare this name against
86 | * @see String#contentEquals(CharSequence)
87 | */
88 | boolean contentEquals(CharSequence cs);
89 | }
90 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/lang/model/util/AbstractElementVisitor7.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.lang.model.util;
27 |
28 | import javax.annotation.processing.SupportedSourceVersion;
29 | import javax.lang.model.SourceVersion;
30 | import static javax.lang.model.SourceVersion.*;
31 |
32 |
33 | /**
34 | * A skeletal visitor of program elements with default behavior
35 | * appropriate for the {@link SourceVersion#RELEASE_7 RELEASE_7}
36 | * source version.
37 | *
38 | * WARNING: The {@code ElementVisitor} interface
39 | * implemented by this class may have methods added to it in the
40 | * future to accommodate new, currently unknown, language structures
41 | * added to future versions of the Java™ programming language.
42 | * Therefore, methods whose names begin with {@code "visit"} may be
43 | * added to this class in the future; to avoid incompatibilities,
44 | * classes which extend this class should not declare any instance
45 | * methods with names beginning with {@code "visit"}.
46 | *
47 | * When such a new visit method is added, the default
48 | * implementation in this class will be to call the {@link
49 | * #visitUnknown visitUnknown} method. A new abstract element visitor
50 | * class will also be introduced to correspond to the new language
51 | * level; this visitor will have different default behavior for the
52 | * visit method in question. When the new visitor is introduced, all
53 | * or portions of this visitor may be deprecated.
54 | *
55 | * Note that adding a default implementation of a new visit method
56 | * in a visitor class will occur instead of adding a default
57 | * method directly in the visitor interface since a Java SE 8
58 | * language feature cannot be used to this version of the API since
59 | * this version is required to be runnable on Java SE 7
60 | * implementations. Future versions of the API that are only required
61 | * to run on Java SE 8 and later may take advantage of default methods
62 | * in this situation.
63 | *
64 | * @param the type of the additional parameter to this visitor's
67 | * methods. Use {@code Void} for visitors that do not need an
68 | * additional parameter.
69 | *
70 | * @see AbstractElementVisitor6
71 | * @see AbstractElementVisitor8
72 | * @since 1.7
73 | */
74 | @SupportedSourceVersion(RELEASE_7)
75 | public abstract class AbstractElementVisitor7 WARNING: The {@code ElementVisitor} interface
39 | * implemented by this class may have methods added to it in the
40 | * future to accommodate new, currently unknown, language structures
41 | * added to future versions of the Java™ programming language.
42 | * Therefore, methods whose names begin with {@code "visit"} may be
43 | * added to this class in the future; to avoid incompatibilities,
44 | * classes which extend this class should not declare any instance
45 | * methods with names beginning with {@code "visit"}.
46 | *
47 | * When such a new visit method is added, the default
48 | * implementation in this class will be to call the {@link
49 | * #visitUnknown visitUnknown} method. A new abstract element visitor
50 | * class will also be introduced to correspond to the new language
51 | * level; this visitor will have different default behavior for the
52 | * visit method in question. When the new visitor is introduced, all
53 | * or portions of this visitor may be deprecated.
54 | *
55 | * Note that adding a default implementation of a new visit method
56 | * in a visitor class will occur instead of adding a default
57 | * method directly in the visitor interface since a Java SE 8
58 | * language feature cannot be used to this version of the API since
59 | * this version is required to be runnable on Java SE 7
60 | * implementations. Future versions of the API that are only required
61 | * to run on Java SE 8 and later may take advantage of default methods
62 | * in this situation.
63 | *
64 | * @param the type of the additional parameter to this visitor's
67 | * methods. Use {@code Void} for visitors that do not need an
68 | * additional parameter.
69 | *
70 | * @see AbstractElementVisitor6
71 | * @see AbstractElementVisitor7
72 | * @since 1.8
73 | */
74 | @SupportedSourceVersion(RELEASE_8)
75 | public abstract class AbstractElementVisitor8 WARNING: The {@code TypeVisitor} interface implemented
36 | * by this class may have methods added to it in the future to
37 | * accommodate new, currently unknown, language structures added to
38 | * future versions of the Java™ programming language.
39 | * Therefore, methods whose names begin with {@code "visit"} may be
40 | * added to this class in the future; to avoid incompatibilities,
41 | * classes which extend this class should not declare any instance
42 | * methods with names beginning with {@code "visit"}.
43 | *
44 | * When such a new visit method is added, the default
45 | * implementation in this class will be to call the {@link
46 | * #visitUnknown visitUnknown} method. A new abstract type visitor
47 | * class will also be introduced to correspond to the new language
48 | * level; this visitor will have different default behavior for the
49 | * visit method in question. When the new visitor is introduced, all
50 | * or portions of this visitor may be deprecated.
51 | *
52 | * Note that adding a default implementation of a new visit method
53 | * in a visitor class will occur instead of adding a default
54 | * method directly in the visitor interface since a Java SE 8
55 | * language feature cannot be used to this version of the API since
56 | * this version is required to be runnable on Java SE 7
57 | * implementations. Future versions of the API that are only required
58 | * to run on Java SE 8 and later may take advantage of default methods
59 | * in this situation.
60 | *
61 | * @param the type of the additional parameter to this visitor's
64 | * methods. Use {@code Void} for visitors that do not need an
65 | * additional parameter.
66 | *
67 | * @see AbstractTypeVisitor6
68 | * @see AbstractTypeVisitor8
69 | * @since 1.7
70 | */
71 | public abstract class AbstractTypeVisitor7 WARNING: The {@code TypeVisitor} interface implemented
36 | * by this class may have methods added to it in the future to
37 | * accommodate new, currently unknown, language structures added to
38 | * future versions of the Java™ programming language.
39 | * Therefore, methods whose names begin with {@code "visit"} may be
40 | * added to this class in the future; to avoid incompatibilities,
41 | * classes which extend this class should not declare any instance
42 | * methods with names beginning with {@code "visit"}.
43 | *
44 | * When such a new visit method is added, the default
45 | * implementation in this class will be to call the {@link
46 | * #visitUnknown visitUnknown} method. A new abstract type visitor
47 | * class will also be introduced to correspond to the new language
48 | * level; this visitor will have different default behavior for the
49 | * visit method in question. When the new visitor is introduced, all
50 | * or portions of this visitor may be deprecated.
51 | *
52 | * Note that adding a default implementation of a new visit method
53 | * in a visitor class will occur instead of adding a default
54 | * method directly in the visitor interface since a Java SE 8
55 | * language feature cannot be used to this version of the API since
56 | * this version is required to be runnable on Java SE 7
57 | * implementations. Future versions of the API that are only required
58 | * to run on Java SE 8 and later may take advantage of default methods
59 | * in this situation.
60 | *
61 | * @param the type of the additional parameter to this visitor's
64 | * methods. Use {@code Void} for visitors that do not need an
65 | * additional parameter.
66 | *
67 | * @see AbstractTypeVisitor6
68 | * @see AbstractTypeVisitor7
69 | * @since 1.8
70 | */
71 | public abstract class AbstractTypeVisitor8 Note that it is possible additional nesting kinds will be added
36 | * in future versions of the platform.
37 | *
38 | * Example: The classes below are annotated with their nesting kind.
39 | * Note that it is possible additional element kinds will be added
32 | * to accommodate new, currently unknown, language structures added to
33 | * future versions of the Java™ programming language.
34 | *
35 | * @author Joseph D. Darcy
36 | * @author Scott Seligman
37 | * @author Peter von der Ahé
38 | * @see Element
39 | * @since 1.6
40 | */
41 | public enum ElementKind {
42 |
43 | /** A package. */
44 | PACKAGE,
45 |
46 | // Declared types
47 | /** An enum type. */
48 | ENUM,
49 | /** A class not described by a more specific kind (like {@code ENUM}). */
50 | CLASS,
51 | /** An annotation type. */
52 | ANNOTATION_TYPE,
53 | /**
54 | * An interface not described by a more specific kind (like
55 | * {@code ANNOTATION_TYPE}).
56 | */
57 | INTERFACE,
58 |
59 | // Variables
60 | /** An enum constant. */
61 | ENUM_CONSTANT,
62 | /**
63 | * A field not described by a more specific kind (like
64 | * {@code ENUM_CONSTANT}).
65 | */
66 | FIELD,
67 | /** A parameter of a method or constructor. */
68 | PARAMETER,
69 | /** A local variable. */
70 | LOCAL_VARIABLE,
71 | /** A parameter of an exception handler. */
72 | EXCEPTION_PARAMETER,
73 |
74 | // Executables
75 | /** A method. */
76 | METHOD,
77 | /** A constructor. */
78 | CONSTRUCTOR,
79 | /** A static initializer. */
80 | STATIC_INIT,
81 | /** An instance initializer. */
82 | INSTANCE_INIT,
83 |
84 | /** A type parameter. */
85 | TYPE_PARAMETER,
86 |
87 | /**
88 | * An implementation-reserved element. This is not the element
89 | * you are looking for.
90 | */
91 | OTHER,
92 |
93 | /**
94 | * A resource variable.
95 | * @since 1.7
96 | */
97 | RESOURCE_VARIABLE;
98 |
99 |
100 | /**
101 | * Returns {@code true} if this is a kind of class:
102 | * either {@code CLASS} or {@code ENUM}.
103 | *
104 | * @return {@code true} if this is a kind of class
105 | */
106 | public boolean isClass() {
107 | return this == CLASS || this == ENUM;
108 | }
109 |
110 | /**
111 | * Returns {@code true} if this is a kind of interface:
112 | * either {@code INTERFACE} or {@code ANNOTATION_TYPE}.
113 | *
114 | * @return {@code true} if this is a kind of interface
115 | */
116 | public boolean isInterface() {
117 | return this == INTERFACE || this == ANNOTATION_TYPE;
118 | }
119 |
120 | /**
121 | * Returns {@code true} if this is a kind of field:
122 | * either {@code FIELD} or {@code ENUM_CONSTANT}.
123 | *
124 | * @return {@code true} if this is a kind of field
125 | */
126 | public boolean isField() {
127 | return this == FIELD || this == ENUM_CONSTANT;
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/lang/model/type/ExecutableType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.lang.model.type;
27 |
28 |
29 | import java.util.List;
30 |
31 | import javax.lang.model.element.ExecutableElement;
32 |
33 | /**
34 | * Represents the type of an executable. An executable
35 | * is a method, constructor, or initializer.
36 | *
37 | * The executable is
38 | * represented as when viewed as a method (or constructor or
39 | * initializer) of some reference type.
40 | * If that reference type is parameterized, then its actual
41 | * type arguments are substituted into any types returned by the methods of
42 | * this interface.
43 | *
44 | * @author Joseph D. Darcy
45 | * @author Scott Seligman
46 | * @author Peter von der Ahé
47 | * @see ExecutableElement
48 | * @since 1.6
49 | */
50 | public interface ExecutableType extends TypeMirror {
51 |
52 | /**
53 | * Returns the type variables declared by the formal type parameters
54 | * of this executable.
55 | *
56 | * @return the type variables declared by the formal type parameters,
57 | * or an empty list if there are none
58 | */
59 | List extends TypeVariable> getTypeVariables();
60 |
61 | /**
62 | * Returns the return type of this executable.
63 | * Returns a {@link NoType} with kind {@link TypeKind#VOID VOID}
64 | * if this executable is not a method, or is a method that does not
65 | * return a value.
66 | *
67 | * @return the return type of this executable
68 | */
69 | TypeMirror getReturnType();
70 |
71 | /**
72 | * Returns the types of this executable's formal parameters.
73 | *
74 | * @return the types of this executable's formal parameters,
75 | * or an empty list if there are none
76 | */
77 | List extends TypeMirror> getParameterTypes();
78 |
79 | /**
80 | * Returns the receiver type of this executable,
81 | * or {@link javax.lang.model.type.NoType NoType} with
82 | * kind {@link javax.lang.model.type.TypeKind#NONE NONE}
83 | * if the executable has no receiver type.
84 | *
85 | * An executable which is an instance method, or a constructor of an
86 | * inner class, has a receiver type derived from the {@linkplain
87 | * ExecutableElement#getEnclosingElement declaring type}.
88 | *
89 | * An executable which is a static method, or a constructor of a
90 | * non-inner class, or an initializer (static or instance), has no
91 | * receiver type.
92 | *
93 | * @return the receiver type of this executable
94 | * @since 1.8
95 | */
96 | TypeMirror getReceiverType();
97 |
98 | /**
99 | * Returns the exceptions and other throwables listed in this
100 | * executable's {@code throws} clause.
101 | *
102 | * @return the exceptions and other throwables listed in this
103 | * executable's {@code throws} clause,
104 | * or an empty list if there are none.
105 | */
106 | List extends TypeMirror> getThrownTypes();
107 | }
108 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/annotation/processing/Messager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.annotation.processing;
27 |
28 | import javax.annotation.*;
29 | import javax.tools.Diagnostic;
30 | import javax.lang.model.element.*;
31 |
32 | /**
33 | * A {@code Messager} provides the way for an annotation processor to
34 | * report error messages, warnings, and other notices. Elements,
35 | * annotations, and annotation values can be passed to provide a
36 | * location hint for the message. However, such location hints may be
37 | * unavailable or only approximate.
38 | *
39 | * Printing a message with an {@linkplain
40 | * javax.tools.Diagnostic.Kind#ERROR error kind} will {@linkplain
41 | * RoundEnvironment#errorRaised raise an error}.
42 | *
43 | * Note that the messages "printed" by methods in this
44 | * interface may or may not appear as textual output to a location
45 | * like {@link System#out} or {@link System#err}. Implementations may
46 | * choose to present this information in a different fashion, such as
47 | * messages in a window.
48 | *
49 | * @author Joseph D. Darcy
50 | * @author Scott Seligman
51 | * @author Peter von der Ahé
52 | * @see ProcessingEnvironment#getLocale
53 | * @since 1.6
54 | */
55 | public interface Messager {
56 | /**
57 | * Prints a message of the specified kind.
58 | *
59 | * @param kind the kind of message
60 | * @param msg the message, or an empty string if none
61 | */
62 | void printMessage(Diagnostic.Kind kind, CharSequence msg);
63 |
64 | /**
65 | * Prints a message of the specified kind at the location of the
66 | * element.
67 | *
68 | * @param kind the kind of message
69 | * @param msg the message, or an empty string if none
70 | * @param e the element to use as a position hint
71 | */
72 | void printMessage(Diagnostic.Kind kind, CharSequence msg, Element e);
73 |
74 | /**
75 | * Prints a message of the specified kind at the location of the
76 | * annotation mirror of the annotated element.
77 | *
78 | * @param kind the kind of message
79 | * @param msg the message, or an empty string if none
80 | * @param e the annotated element
81 | * @param a the annotation to use as a position hint
82 | */
83 | void printMessage(Diagnostic.Kind kind, CharSequence msg, Element e, AnnotationMirror a);
84 |
85 | /**
86 | * Prints a message of the specified kind at the location of the
87 | * annotation value inside the annotation mirror of the annotated
88 | * element.
89 | *
90 | * @param kind the kind of message
91 | * @param msg the message, or an empty string if none
92 | * @param e the annotated element
93 | * @param a the annotation containing the annotation value
94 | * @param v the annotation value to use as a position hint
95 | */
96 | void printMessage(Diagnostic.Kind kind,
97 | CharSequence msg,
98 | Element e,
99 | AnnotationMirror a,
100 | AnnotationValue v);
101 | }
102 |
--------------------------------------------------------------------------------
/sample/src/main/java/me/denley/preferencebinder/sample/MainActivity.java:
--------------------------------------------------------------------------------
1 | package me.denley.preferencebinder.sample;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.app.Activity;
5 | import android.content.SharedPreferences;
6 | import android.os.Bundle;
7 | import android.os.Handler;
8 | import android.os.Looper;
9 | import android.preference.PreferenceManager;
10 | import android.widget.CheckBox;
11 | import android.widget.SeekBar;
12 |
13 | import me.denley.preferencebinder.BindPref;
14 | import me.denley.preferencebinder.PreferenceBinder;
15 | import me.denley.preferencebinder.R;
16 | import me.denley.preferencebinder.internal.WidgetBindingType;
17 |
18 |
19 | public class MainActivity extends Activity {
20 |
21 | private static final long PREFERENCE_CHANGE_INTERVAL_MS = 500;
22 | private static final long PREFERENCE_CHANGE_INITIAL_WAIT_MS = 3000;
23 |
24 |
25 | @BindPref(value = "boolean_pref_key", bindTo = WidgetBindingType.CHECKED)
26 | CheckBox booleanPreferenceDisplay;
27 |
28 | @BindPref(value = "integer_pref_key", bindTo = WidgetBindingType.SEEKBAR_PROGRESS)
29 | SeekBar integerPreferenceDisplay;
30 |
31 | @BindPref(value = "boolean_pref_key", listen = true)
32 | boolean booleanPrefValue;
33 |
34 | Looper preferenceChangeLooper;
35 | Handler handler;
36 |
37 | Runnable externalPreferenceChanger = new Runnable(){
38 | public void run(){
39 | changePreferenceValues();
40 | handler.postDelayed(externalPreferenceChanger, PREFERENCE_CHANGE_INTERVAL_MS);
41 | }
42 | };
43 |
44 | @Override protected void onCreate(Bundle savedInstanceState) {
45 | super.onCreate(savedInstanceState);
46 | setContentView(R.layout.activity_main);
47 | booleanPreferenceDisplay = (CheckBox) findViewById(R.id.pref_boolean);
48 | integerPreferenceDisplay = (SeekBar) findViewById(R.id.pref_integer);
49 | PreferenceBinder.bind(this);
50 | startHandlerOnBackgroundThread();
51 | }
52 |
53 | @BindPref(value = {"integer_pref_key", "boolean_pref_key"}, init = false)
54 | void onNewValue3(){
55 |
56 | }
57 |
58 | private void startHandlerOnBackgroundThread(){
59 | new Thread(){
60 | public void run(){
61 | startHandler();
62 | Looper.loop();
63 | }
64 | }.start();
65 | }
66 |
67 | private void startHandler(){
68 | Looper.prepare();
69 | preferenceChangeLooper = Looper.myLooper();
70 | handler = new Handler(preferenceChangeLooper);
71 | handler.postDelayed(externalPreferenceChanger, PREFERENCE_CHANGE_INITIAL_WAIT_MS);
72 | }
73 |
74 | @SuppressLint("CommitPrefEdits")
75 | private void changePreferenceValues(){
76 | final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
77 | final boolean booleanPrefValue = !prefs.getBoolean("boolean_pref_key", false);
78 | final int integerPrefValue = (prefs.getInt("integer_pref_key", 0) + 1) % 100;
79 |
80 | prefs.edit()
81 | .putBoolean("boolean_pref_key", booleanPrefValue)
82 | .putInt("integer_pref_key", integerPrefValue)
83 | .commit();
84 | }
85 |
86 | @Override protected void onDestroy() {
87 | PreferenceBinder.unbind(this);
88 | handler.removeCallbacks(externalPreferenceChanger);
89 | if(preferenceChangeLooper != null) {
90 | preferenceChangeLooper.quit();
91 | }
92 | super.onDestroy();
93 | }
94 |
95 | }
96 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/tools/ForwardingFileObject.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.tools;
27 |
28 | import java.io.IOException;
29 | import java.io.InputStream;
30 | import java.io.OutputStream;
31 | import java.io.Reader;
32 | import java.io.Writer;
33 | import java.net.URI;
34 |
35 | /**
36 | * Forwards calls to a given file object. Subclasses of this class
37 | * might override some of these methods and might also provide
38 | * additional fields and methods.
39 | *
40 | * @param Methods in this class may be overridden subject to their
40 | * general contract. Note that annotating methods in concrete
41 | * subclasses with {@link java.lang.Override @Override} will help
42 | * ensure that methods are overridden as intended.
43 | *
44 | * WARNING: The {@code AnnotationValueVisitor} interface
45 | * implemented by this class may have methods added to it in the
46 | * future to accommodate new, currently unknown, language structures
47 | * added to future versions of the Java™ programming language.
48 | * Therefore, methods whose names begin with {@code "visit"} may be
49 | * added to this class in the future; to avoid incompatibilities,
50 | * classes which extend this class should not declare any instance
51 | * methods with names beginning with {@code "visit"}.
52 | *
53 | * When such a new visit method is added, the default
54 | * implementation in this class will be to call the {@link
55 | * #visitUnknown visitUnknown} method. A new simple annotation
56 | * value visitor class will also be introduced to correspond to the
57 | * new language level; this visitor will have different default
58 | * behavior for the visit method in question. When the new visitor is
59 | * introduced, all or portions of this visitor may be deprecated.
60 | *
61 | * Note that adding a default implementation of a new visit method
62 | * in a visitor class will occur instead of adding a default
63 | * method directly in the visitor interface since a Java SE 8
64 | * language feature cannot be used to this version of the API since
65 | * this version is required to be runnable on Java SE 7
66 | * implementations. Future versions of the API that are only required
67 | * to run on Java SE 8 and later may take advantage of default methods
68 | * in this situation.
69 | *
70 | * @param the type of the additional parameter to this visitor's methods.
72 | *
73 | * @see SimpleAnnotationValueVisitor6
74 | * @see SimpleAnnotationValueVisitor8
75 | * @since 1.7
76 | */
77 | @SupportedSourceVersion(RELEASE_7)
78 | public class SimpleAnnotationValueVisitor7 Methods in this class may be overridden subject to their
40 | * general contract. Note that annotating methods in concrete
41 | * subclasses with {@link java.lang.Override @Override} will help
42 | * ensure that methods are overridden as intended.
43 | *
44 | * WARNING: The {@code AnnotationValueVisitor} interface
45 | * implemented by this class may have methods added to it in the
46 | * future to accommodate new, currently unknown, language structures
47 | * added to future versions of the Java™ programming language.
48 | * Therefore, methods whose names begin with {@code "visit"} may be
49 | * added to this class in the future; to avoid incompatibilities,
50 | * classes which extend this class should not declare any instance
51 | * methods with names beginning with {@code "visit"}.
52 | *
53 | * When such a new visit method is added, the default
54 | * implementation in this class will be to call the {@link
55 | * #visitUnknown visitUnknown} method. A new simple annotation
56 | * value visitor class will also be introduced to correspond to the
57 | * new language level; this visitor will have different default
58 | * behavior for the visit method in question. When the new visitor is
59 | * introduced, all or portions of this visitor may be deprecated.
60 | *
61 | * Note that adding a default implementation of a new visit method
62 | * in a visitor class will occur instead of adding a default
63 | * method directly in the visitor interface since a Java SE 8
64 | * language feature cannot be used to this version of the API since
65 | * this version is required to be runnable on Java SE 7
66 | * implementations. Future versions of the API that are only required
67 | * to run on Java SE 8 and later may take advantage of default methods
68 | * in this situation.
69 | *
70 | * @param the type of the additional parameter to this visitor's methods.
72 | *
73 | * @see SimpleAnnotationValueVisitor6
74 | * @see SimpleAnnotationValueVisitor7
75 | * @since 1.8
76 | */
77 | @SupportedSourceVersion(RELEASE_8)
78 | public class SimpleAnnotationValueVisitor8 Note that it is possible additional type kinds will be added to
33 | * accommodate new, currently unknown, language structures added to
34 | * future versions of the Java™ programming language.
35 | *
36 | * @author Joseph D. Darcy
37 | * @author Scott Seligman
38 | * @author Peter von der Ahé
39 | * @see TypeMirror
40 | * @since 1.6
41 | */
42 | public enum TypeKind {
43 | /**
44 | * The primitive type {@code boolean}.
45 | */
46 | BOOLEAN,
47 |
48 | /**
49 | * The primitive type {@code byte}.
50 | */
51 | BYTE,
52 |
53 | /**
54 | * The primitive type {@code short}.
55 | */
56 | SHORT,
57 |
58 | /**
59 | * The primitive type {@code int}.
60 | */
61 | INT,
62 |
63 | /**
64 | * The primitive type {@code long}.
65 | */
66 | LONG,
67 |
68 | /**
69 | * The primitive type {@code char}.
70 | */
71 | CHAR,
72 |
73 | /**
74 | * The primitive type {@code float}.
75 | */
76 | FLOAT,
77 |
78 | /**
79 | * The primitive type {@code double}.
80 | */
81 | DOUBLE,
82 |
83 | /**
84 | * The pseudo-type corresponding to the keyword {@code void}.
85 | * @see NoType
86 | */
87 | VOID,
88 |
89 | /**
90 | * A pseudo-type used where no actual type is appropriate.
91 | * @see NoType
92 | */
93 | NONE,
94 |
95 | /**
96 | * The null type.
97 | */
98 | NULL,
99 |
100 | /**
101 | * An array type.
102 | */
103 | ARRAY,
104 |
105 | /**
106 | * A class or interface type.
107 | */
108 | DECLARED,
109 |
110 | /**
111 | * A class or interface type that could not be resolved.
112 | */
113 | ERROR,
114 |
115 | /**
116 | * A type variable.
117 | */
118 | TYPEVAR,
119 |
120 | /**
121 | * A wildcard type argument.
122 | */
123 | WILDCARD,
124 |
125 | /**
126 | * A pseudo-type corresponding to a package element.
127 | * @see NoType
128 | */
129 | PACKAGE,
130 |
131 | /**
132 | * A method, constructor, or initializer.
133 | */
134 | EXECUTABLE,
135 |
136 | /**
137 | * An implementation-reserved type.
138 | * This is not the type you are looking for.
139 | */
140 | OTHER,
141 |
142 | /**
143 | * A union type.
144 | *
145 | * @since 1.7
146 | */
147 | UNION,
148 |
149 | /**
150 | * An intersection type.
151 | *
152 | * @since 1.8
153 | */
154 | INTERSECTION;
155 |
156 | /**
157 | * Returns {@code true} if this kind corresponds to a primitive
158 | * type and {@code false} otherwise.
159 | * @return {@code true} if this kind corresponds to a primitive type
160 | */
161 | public boolean isPrimitive() {
162 | switch(this) {
163 | case BOOLEAN:
164 | case BYTE:
165 | case SHORT:
166 | case INT:
167 | case LONG:
168 | case CHAR:
169 | case FLOAT:
170 | case DOUBLE:
171 | return true;
172 |
173 | default:
174 | return false;
175 | }
176 | }
177 | }
178 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/lang/model/type/TypeMirror.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.lang.model.type;
27 |
28 | import java.lang.annotation.Annotation;
29 | import java.util.List;
30 | import javax.lang.model.element.*;
31 | import javax.lang.model.util.Types;
32 |
33 | /**
34 | * Represents a type in the Java programming language.
35 | * Types include primitive types, declared types (class and interface types),
36 | * array types, type variables, and the null type.
37 | * Also represented are wildcard type arguments,
38 | * the signature and return types of executables,
39 | * and pseudo-types corresponding to packages and to the keyword {@code void}.
40 | *
41 | * Types should be compared using the utility methods in {@link
42 | * Types}. There is no guarantee that any particular type will always
43 | * be represented by the same object.
44 | *
45 | * To implement operations based on the class of an {@code
46 | * TypeMirror} object, either use a {@linkplain TypeVisitor visitor}
47 | * or use the result of the {@link #getKind} method. Using {@code
48 | * instanceof} is not necessarily a reliable idiom for
49 | * determining the effective class of an object in this modeling
50 | * hierarchy since an implementation may choose to have a single
51 | * object implement multiple {@code TypeMirror} subinterfaces.
52 | *
53 | * @author Joseph D. Darcy
54 | * @author Scott Seligman
55 | * @author Peter von der Ahé
56 | * @see Element
57 | * @see Types
58 | * @since 1.6
59 | */
60 | public interface TypeMirror extends javax.lang.model.AnnotatedConstruct {
61 |
62 | /**
63 | * Returns the {@code kind} of this type.
64 | *
65 | * @return the kind of this type
66 | */
67 | TypeKind getKind();
68 |
69 | /**
70 | * Obeys the general contract of {@link Object#equals Object.equals}.
71 | * This method does not, however, indicate whether two types represent
72 | * the same type.
73 | * Semantic comparisons of type equality should instead use
74 | * {@link Types#isSameType(TypeMirror, TypeMirror)}.
75 | * The results of {@code t1.equals(t2)} and
76 | * {@code Types.isSameType(t1, t2)} may differ.
77 | *
78 | * @param obj the object to be compared with this type
79 | * @return {@code true} if the specified object is equal to this one
80 | */
81 | boolean equals(Object obj);
82 |
83 | /**
84 | * Obeys the general contract of {@link Object#hashCode Object.hashCode}.
85 | *
86 | * @see #equals
87 | */
88 | int hashCode();
89 |
90 | /**
91 | * Returns an informative string representation of this type. If
92 | * possible, the string should be of a form suitable for
93 | * representing this type in source code. Any names embedded in
94 | * the result are qualified if possible.
95 | *
96 | * @return a string representation of this type
97 | */
98 | String toString();
99 |
100 | /**
101 | * Applies a visitor to this type.
102 | *
103 | * @param the type of the additional parameter to the visitor's methods
105 | * @param v the visitor operating on this type
106 | * @param p additional parameter to the visitor
107 | * @return a visitor-specified result
108 | */
109 | Methods in this class may be overridden subject to their
43 | * general contract. Note that annotating methods in concrete
44 | * subclasses with {@link java.lang.Override @Override} will help
45 | * ensure that methods are overridden as intended.
46 | *
47 | * WARNING: The {@code ElementVisitor} interface
48 | * implemented by this class may have methods added to it in the
49 | * future to accommodate new, currently unknown, language structures
50 | * added to future versions of the Java™ programming language.
51 | * Therefore, methods whose names begin with {@code "visit"} may be
52 | * added to this class in the future; to avoid incompatibilities,
53 | * classes which extend this class should not declare any instance
54 | * methods with names beginning with {@code "visit"}.
55 | *
56 | * When such a new visit method is added, the default
57 | * implementation in this class will be to call the {@link
58 | * #visitUnknown visitUnknown} method. A new simple element visitor
59 | * class will also be introduced to correspond to the new language
60 | * level; this visitor will have different default behavior for the
61 | * visit method in question. When the new visitor is introduced, all
62 | * or portions of this visitor may be deprecated.
63 | *
64 | * Note that adding a default implementation of a new visit method
65 | * in a visitor class will occur instead of adding a default
66 | * method directly in the visitor interface since a Java SE 8
67 | * language feature cannot be used to this version of the API since
68 | * this version is required to be runnable on Java SE 7
69 | * implementations. Future versions of the API that are only required
70 | * to run on Java SE 8 and later may take advantage of default methods
71 | * in this situation.
72 | *
73 | * @param the type of the additional parameter to this visitor's methods. Use {@code Void}
76 | * for visitors that do not need an additional parameter.
77 | *
78 | * @see SimpleElementVisitor6
79 | * @see SimpleElementVisitor7
80 | * @since 1.8
81 | */
82 | @SupportedSourceVersion(RELEASE_8)
83 | public class SimpleElementVisitor8 All methods in this interface might throw a SecurityException if
36 | * a security exception occurs.
37 | *
38 | * Unless explicitly allowed, all methods in this interface might
39 | * throw a NullPointerException if given a {@code null} argument.
40 | *
41 | * @author Peter von der Ahé
42 | * @author Jonathan Gibbons
43 | * @see JavaFileManager
44 | * @since 1.6
45 | */
46 | public interface JavaFileObject extends FileObject {
47 |
48 | /**
49 | * Kinds of JavaFileObjects.
50 | */
51 | enum Kind {
52 | /**
53 | * Source files written in the Java programming language. For
54 | * example, regular files ending with {@code .java}.
55 | */
56 | SOURCE(".java"),
57 |
58 | /**
59 | * Class files for the Java Virtual Machine. For example,
60 | * regular files ending with {@code .class}.
61 | */
62 | CLASS(".class"),
63 |
64 | /**
65 | * HTML files. For example, regular files ending with {@code
66 | * .html}.
67 | */
68 | HTML(".html"),
69 |
70 | /**
71 | * Any other kind.
72 | */
73 | OTHER("");
74 | /**
75 | * The extension which (by convention) is normally used for
76 | * this kind of file object. If no convention exists, the
77 | * empty string ({@code ""}) is used.
78 | */
79 | public final String extension;
80 | private Kind(String extension) {
81 | extension.getClass(); // null check
82 | this.extension = extension;
83 | }
84 | };
85 |
86 | /**
87 | * Gets the kind of this file object.
88 | *
89 | * @return the kind
90 | */
91 | Kind getKind();
92 |
93 | /**
94 | * Checks if this file object is compatible with the specified
95 | * simple name and kind. A simple name is a single identifier
96 | * (not qualified) as defined in
97 | * The Java™ Language Specification,
98 | * section 6.2 "Names and Identifiers".
99 | *
100 | * @param simpleName a simple name of a class
101 | * @param kind a kind
102 | * @return {@code true} if this file object is compatible; false
103 | * otherwise
104 | */
105 | boolean isNameCompatible(String simpleName, Kind kind);
106 |
107 | /**
108 | * Provides a hint about the nesting level of the class
109 | * represented by this file object. This method may return
110 | * {@link NestingKind#MEMBER} to mean
111 | * {@link NestingKind#LOCAL} or {@link NestingKind#ANONYMOUS}.
112 | * If the nesting level is not known or this file object does not
113 | * represent a class file this method returns {@code null}.
114 | *
115 | * @return the nesting kind, or {@code null} if the nesting kind
116 | * is not known
117 | */
118 | NestingKind getNestingKind();
119 |
120 | /**
121 | * Provides a hint about the access level of the class represented
122 | * by this file object. If the access level is not known or if
123 | * this file object does not represent a class file this method
124 | * returns {@code null}.
125 | *
126 | * @return the access level
127 | */
128 | Modifier getAccessLevel();
129 |
130 | }
131 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/lang/model/util/ElementKindVisitor8.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.lang.model.util;
27 |
28 | import javax.lang.model.element.*;
29 | import javax.annotation.processing.SupportedSourceVersion;
30 | import static javax.lang.model.SourceVersion.*;
31 | import javax.lang.model.SourceVersion;
32 |
33 | /**
34 | * A visitor of program elements based on their {@linkplain
35 | * ElementKind kind} with default behavior appropriate for the {@link
36 | * SourceVersion#RELEASE_8 RELEASE_8} source version. For {@linkplain
37 | * Element elements} XYZ that may have more than one
38 | * kind, the visitXYZ methods in this class delegate
39 | * to the visitXYZKind method corresponding to the
40 | * first argument's kind. The visitXYZKind methods
41 | * call {@link #defaultAction defaultAction}, passing their arguments
42 | * to {@code defaultAction}'s corresponding parameters.
43 | *
44 | * Methods in this class may be overridden subject to their
45 | * general contract. Note that annotating methods in concrete
46 | * subclasses with {@link java.lang.Override @Override} will help
47 | * ensure that methods are overridden as intended.
48 | *
49 | * WARNING: The {@code ElementVisitor} interface
50 | * implemented by this class may have methods added to it or the
51 | * {@code ElementKind} {@code enum} used in this case may have
52 | * constants added to it in the future to accommodate new, currently
53 | * unknown, language structures added to future versions of the
54 | * Java™ programming language. Therefore, methods whose names
55 | * begin with {@code "visit"} may be added to this class in the
56 | * future; to avoid incompatibilities, classes which extend this class
57 | * should not declare any instance methods with names beginning with
58 | * {@code "visit"}.
59 | *
60 | * When such a new visit method is added, the default
61 | * implementation in this class will be to call the {@link
62 | * #visitUnknown visitUnknown} method. A new abstract element kind
63 | * visitor class will also be introduced to correspond to the new
64 | * language level; this visitor will have different default behavior
65 | * for the visit method in question. When the new visitor is
66 | * introduced, all or portions of this visitor may be deprecated.
67 | *
68 | * Note that adding a default implementation of a new visit method
69 | * in a visitor class will occur instead of adding a default
70 | * method directly in the visitor interface since a Java SE 8
71 | * language feature cannot be used to this version of the API since
72 | * this version is required to be runnable on Java SE 7
73 | * implementations. Future versions of the API that are only required
74 | * to run on Java SE 8 and later may take advantage of default methods
75 | * in this situation.
76 | *
77 | * @param the type of the additional parameter to this visitor's
80 | * methods. Use {@code Void} for visitors that do not need an
81 | * additional parameter.
82 | *
83 | * @see ElementKindVisitor6
84 | * @see ElementKindVisitor7
85 | * @since 1.8
86 | */
87 | @SupportedSourceVersion(RELEASE_8)
88 | public class ElementKindVisitor8 Methods in this class may be overridden subject to their
44 | * general contract. Note that annotating methods in concrete
45 | * subclasses with {@link java.lang.Override @Override} will help
46 | * ensure that methods are overridden as intended.
47 | *
48 | * WARNING: The {@code ElementVisitor} interface
49 | * implemented by this class may have methods added to it in the
50 | * future to accommodate new, currently unknown, language structures
51 | * added to future versions of the Java™ programming language.
52 | * Therefore, methods whose names begin with {@code "visit"} may be
53 | * added to this class in the future; to avoid incompatibilities,
54 | * classes which extend this class should not declare any instance
55 | * methods with names beginning with {@code "visit"}.
56 | *
57 | * When such a new visit method is added, the default
58 | * implementation in this class will be to call the {@link
59 | * #visitUnknown visitUnknown} method. A new simple element visitor
60 | * class will also be introduced to correspond to the new language
61 | * level; this visitor will have different default behavior for the
62 | * visit method in question. When the new visitor is introduced, all
63 | * or portions of this visitor may be deprecated.
64 | *
65 | * Note that adding a default implementation of a new visit method
66 | * in a visitor class will occur instead of adding a default
67 | * method directly in the visitor interface since a Java SE 8
68 | * language feature cannot be used to this version of the API since
69 | * this version is required to be runnable on Java SE 7
70 | * implementations. Future versions of the API that are only required
71 | * to run on Java SE 8 and later may take advantage of default methods
72 | * in this situation.
73 | *
74 | * @param the type of the additional parameter to this visitor's methods. Use {@code Void}
77 | * for visitors that do not need an additional parameter.
78 | *
79 | * @see SimpleElementVisitor6
80 | * @see SimpleElementVisitor8
81 | * @since 1.7
82 | */
83 | @SupportedSourceVersion(RELEASE_7)
84 | public class SimpleElementVisitor7 Methods in this class may be overridden subject to their
43 | * general contract. Note that annotating methods in concrete
44 | * subclasses with {@link java.lang.Override @Override} will help
45 | * ensure that methods are overridden as intended.
46 | *
47 | * WARNING: The {@code TypeVisitor} interface implemented
48 | * by this class may have methods added to it in the future to
49 | * accommodate new, currently unknown, language structures added to
50 | * future versions of the Java™ programming language.
51 | * Therefore, methods whose names begin with {@code "visit"} may be
52 | * added to this class in the future; to avoid incompatibilities,
53 | * classes which extend this class should not declare any instance
54 | * methods with names beginning with {@code "visit"}.
55 | *
56 | * When such a new visit method is added, the default
57 | * implementation in this class will be to call the {@link
58 | * #visitUnknown visitUnknown} method. A new simple type visitor
59 | * class will also be introduced to correspond to the new language
60 | * level; this visitor will have different default behavior for the
61 | * visit method in question. When the new visitor is introduced, all
62 | * or portions of this visitor may be deprecated.
63 | *
64 | * Note that adding a default implementation of a new visit method
65 | * in a visitor class will occur instead of adding a default
66 | * method directly in the visitor interface since a Java SE 8
67 | * language feature cannot be used to this version of the API since
68 | * this version is required to be runnable on Java SE 7
69 | * implementations. Future versions of the API that are only required
70 | * to run on Java SE 8 and later may take advantage of default methods
71 | * in this situation.
72 | *
73 | * @param the type of the additional parameter to this visitor's
76 | * methods. Use {@code Void} for visitors that do not need an
77 | * additional parameter.
78 | *
79 | * @see SimpleTypeVisitor6
80 | * @see SimpleTypeVisitor8
81 | * @since 1.7
82 | */
83 | @SupportedSourceVersion(RELEASE_7)
84 | public class SimpleTypeVisitor7 Methods in this class may be overridden subject to their
43 | * general contract. Note that annotating methods in concrete
44 | * subclasses with {@link java.lang.Override @Override} will help
45 | * ensure that methods are overridden as intended.
46 | *
47 | * WARNING: The {@code TypeVisitor} interface implemented
48 | * by this class may have methods added to it in the future to
49 | * accommodate new, currently unknown, language structures added to
50 | * future versions of the Java™ programming language.
51 | * Therefore, methods whose names begin with {@code "visit"} may be
52 | * added to this class in the future; to avoid incompatibilities,
53 | * classes which extend this class should not declare any instance
54 | * methods with names beginning with {@code "visit"}.
55 | *
56 | * When such a new visit method is added, the default
57 | * implementation in this class will be to call the {@link
58 | * #visitUnknown visitUnknown} method. A new simple type visitor
59 | * class will also be introduced to correspond to the new language
60 | * level; this visitor will have different default behavior for the
61 | * visit method in question. When the new visitor is introduced, all
62 | * or portions of this visitor may be deprecated.
63 | *
64 | * Note that adding a default implementation of a new visit method
65 | * in a visitor class will occur instead of adding a default
66 | * method directly in the visitor interface since a Java SE 8
67 | * language feature cannot be used to this version of the API since
68 | * this version is required to be runnable on Java SE 7
69 | * implementations. Future versions of the API that are only required
70 | * to run on Java SE 8 and later may take advantage of default methods
71 | * in this situation.
72 | *
73 | * @param the type of the additional parameter to this visitor's
76 | * methods. Use {@code Void} for visitors that do not need an
77 | * additional parameter.
78 | *
79 | * @see SimpleTypeVisitor6
80 | * @see SimpleTypeVisitor7
81 | * @since 1.8
82 | */
83 | @SupportedSourceVersion(RELEASE_8)
84 | public class SimpleTypeVisitor8 When used in the context of annotation processing, an accurate
40 | * model of the element being represented must be returned. As this
41 | * is a language model, the source code provides the fiducial
42 | * (reference) representation of the construct in question rather than
43 | * a representation in an executable output like a class file.
44 | * Executable output may serve as the basis for creating a modeling
45 | * element. However, the process of translating source code to
46 | * executable output may not permit recovering some aspects of the
47 | * source code representation. For example, annotations with
48 | * {@linkplain java.lang.annotation.RetentionPolicy#SOURCE source}
49 | * {@linkplain java.lang.annotation.Retention retention} cannot be
50 | * recovered from class files and class files might not be able to
51 | * provide source position information.
52 | *
53 | * Names of parameters may not be recoverable from class files.
54 | *
55 | * The {@linkplain javax.lang.model.element.Modifier modifiers} on an
56 | * element may differ in some cases including:
57 | *
58 | * During annotation processing, operating on incomplete or
70 | * erroneous programs is necessary; however, there are fewer
71 | * guarantees about the nature of the resulting model. If the source
72 | * code is not syntactically well-formed or has some other
73 | * irrecoverable error that could not be removed by the generation of
74 | * new types, a model may or may not be provided as a quality of
75 | * implementation issue.
76 | * If a program is syntactically valid but erroneous in some other
77 | * fashion, any returned model must have no less information than if
78 | * all the method bodies in the program were replaced by {@code "throw
79 | * new RuntimeException();"}. If a program refers to a missing type XYZ,
80 | * the returned model must contain no less information than if the
81 | * declaration of type XYZ were assumed to be {@code "class XYZ {}"},
82 | * {@code "interface XYZ {}"}, {@code "enum XYZ {}"}, or {@code
83 | * "@interface XYZ {}"}. If a program refers to a missing type {@code
84 | * XYZ Unless otherwise specified in a particular implementation, the
90 | * collections returned by methods in this package should be expected
91 | * to be unmodifiable by the caller and unsafe for concurrent access.
92 | *
93 | * Unless otherwise specified, methods in this package will throw
94 | * a {@code NullPointerException} if given a {@code null} argument.
95 | *
96 | * @author Joseph D. Darcy
97 | * @author Scott Seligman
98 | * @author Peter von der Ahé
99 | * @since 1.6
100 | */
101 | package javax.lang.model.element;
102 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/lang/model/util/AbstractAnnotationValueVisitor6.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.lang.model.util;
27 |
28 |
29 | import javax.lang.model.element.*;
30 |
31 | import static javax.lang.model.SourceVersion.*;
32 | import javax.lang.model.SourceVersion;
33 | import javax.annotation.processing.SupportedSourceVersion;
34 |
35 | /**
36 | * A skeletal visitor for annotation values with default behavior
37 | * appropriate for the {@link SourceVersion#RELEASE_6 RELEASE_6}
38 | * source version.
39 | *
40 | * WARNING: The {@code AnnotationValueVisitor} interface
41 | * implemented by this class may have methods added to it in the
42 | * future to accommodate new, currently unknown, language structures
43 | * added to future versions of the Java™ programming language.
44 | * Therefore, methods whose names begin with {@code "visit"} may be
45 | * added to this class in the future; to avoid incompatibilities,
46 | * classes which extend this class should not declare any instance
47 | * methods with names beginning with {@code "visit"}.
48 | *
49 | * When such a new visit method is added, the default
50 | * implementation in this class will be to call the {@link
51 | * #visitUnknown visitUnknown} method. A new abstract annotation
52 | * value visitor class will also be introduced to correspond to the
53 | * new language level; this visitor will have different default
54 | * behavior for the visit method in question. When the new visitor is
55 | * introduced, all or portions of this visitor may be deprecated.
56 | *
57 | * Note that adding a default implementation of a new visit method
58 | * in a visitor class will occur instead of adding a default
59 | * method directly in the visitor interface since a Java SE 8
60 | * language feature cannot be used to this version of the API since
61 | * this version is required to be runnable on Java SE 7
62 | * implementations. Future versions of the API that are only required
63 | * to run on Java SE 8 and later may take advantage of default methods
64 | * in this situation.
65 | *
66 | * @param the type of the additional parameter to this visitor's methods.
68 | *
69 | * @author Joseph D. Darcy
70 | * @author Scott Seligman
71 | * @author Peter von der Ahé
72 | *
73 | * @see AbstractAnnotationValueVisitor7
74 | * @see AbstractAnnotationValueVisitor8
75 | * @since 1.6
76 | */
77 | @SupportedSourceVersion(RELEASE_6)
78 | public abstract class AbstractAnnotationValueVisitor6 The default implementation of this method in {@code
113 | * AbstractAnnotationValueVisitor6} will always throw {@code
114 | * UnknownAnnotationValueException}. This behavior is not
115 | * required of a subclass.
116 | *
117 | * @param av {@inheritDoc}
118 | * @param p {@inheritDoc}
119 | */
120 | public R visitUnknown(AnnotationValue av, P p) {
121 | throw new UnknownAnnotationValueException(av, p);
122 | }
123 | }
124 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/lang/model/util/ElementScanner8.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.lang.model.util;
27 |
28 | import javax.lang.model.element.*;
29 | import javax.annotation.processing.SupportedSourceVersion;
30 | import javax.lang.model.SourceVersion;
31 | import static javax.lang.model.SourceVersion.*;
32 |
33 |
34 | /**
35 | * A scanning visitor of program elements with default behavior
36 | * appropriate for the {@link SourceVersion#RELEASE_8 RELEASE_8}
37 | * source version. The visitXYZ methods in this
38 | * class scan their component elements by calling {@code scan} on
39 | * their {@linkplain Element#getEnclosedElements enclosed elements},
40 | * {@linkplain ExecutableElement#getParameters parameters}, etc., as
41 | * indicated in the individual method specifications. A subclass can
42 | * control the order elements are visited by overriding the
43 | * visitXYZ methods. Note that clients of a scanner
44 | * may get the desired behavior be invoking {@code v.scan(e, p)} rather
45 | * than {@code v.visit(e, p)} on the root objects of interest.
46 | *
47 | * When a subclass overrides a visitXYZ method, the
48 | * new method can cause the enclosed elements to be scanned in the
49 | * default way by calling super.visitXYZ. In this
50 | * fashion, the concrete visitor can control the ordering of traversal
51 | * over the component elements with respect to the additional
52 | * processing; for example, consistently calling
53 | * super.visitXYZ at the start of the overridden
54 | * methods will yield a preorder traversal, etc. If the component
55 | * elements should be traversed in some other order, instead of
56 | * calling super.visitXYZ, an overriding visit method
57 | * should call {@code scan} with the elements in the desired order.
58 | *
59 | * Methods in this class may be overridden subject to their
60 | * general contract. Note that annotating methods in concrete
61 | * subclasses with {@link java.lang.Override @Override} will help
62 | * ensure that methods are overridden as intended.
63 | *
64 | * WARNING: The {@code ElementVisitor} interface
65 | * implemented by this class may have methods added to it in the
66 | * future to accommodate new, currently unknown, language structures
67 | * added to future versions of the Java™ programming language.
68 | * Therefore, methods whose names begin with {@code "visit"} may be
69 | * added to this class in the future; to avoid incompatibilities,
70 | * classes which extend this class should not declare any instance
71 | * methods with names beginning with {@code "visit"}.
72 | *
73 | * When such a new visit method is added, the default
74 | * implementation in this class will be to call the {@link
75 | * #visitUnknown visitUnknown} method. A new element scanner visitor
76 | * class will also be introduced to correspond to the new language
77 | * level; this visitor will have different default behavior for the
78 | * visit method in question. When the new visitor is introduced, all
79 | * or portions of this visitor may be deprecated.
80 | *
81 | * @param the type of the additional parameter to this visitor's
84 | * methods. Use {@code Void} for visitors that do not need an
85 | * additional parameter.
86 | *
87 | * @see ElementScanner6
88 | * @see ElementScanner7
89 | * @since 1.8
90 | */
91 | @SupportedSourceVersion(RELEASE_8)
92 | public class ElementScanner8 Methods in this class may be overridden subject to their
45 | * general contract. Note that annotating methods in concrete
46 | * subclasses with {@link java.lang.Override @Override} will help
47 | * ensure that methods are overridden as intended.
48 | *
49 | * WARNING: The {@code TypeVisitor} interface implemented
50 | * by this class may have methods added to it in the future to
51 | * accommodate new, currently unknown, language structures added to
52 | * future versions of the Java™ programming language.
53 | * Therefore, methods whose names begin with {@code "visit"} may be
54 | * added to this class in the future; to avoid incompatibilities,
55 | * classes which extend this class should not declare any instance
56 | * methods with names beginning with {@code "visit"}.
57 | *
58 | * When such a new visit method is added, the default
59 | * implementation in this class will be to call the {@link
60 | * #visitUnknown visitUnknown} method. A new type kind visitor class
61 | * will also be introduced to correspond to the new language level;
62 | * this visitor will have different default behavior for the visit
63 | * method in question. When the new visitor is introduced, all or
64 | * portions of this visitor may be deprecated.
65 | *
66 | * Note that adding a default implementation of a new visit method
67 | * in a visitor class will occur instead of adding a default
68 | * method directly in the visitor interface since a Java SE 8
69 | * language feature cannot be used to this version of the API since
70 | * this version is required to be runnable on Java SE 7
71 | * implementations. Future versions of the API that are only required
72 | * to run on Java SE 8 and later may take advantage of default methods
73 | * in this situation.
74 | *
75 | * @param the type of the additional parameter to this visitor's
78 | * methods. Use {@code Void} for visitors that do not need an
79 | * additional parameter.
80 | *
81 | * @see TypeKindVisitor6
82 | * @see TypeKindVisitor8
83 | * @since 1.7
84 | */
85 | @SupportedSourceVersion(RELEASE_7)
86 | public class TypeKindVisitor7 Methods in this class may be overridden subject to their
45 | * general contract. Note that annotating methods in concrete
46 | * subclasses with {@link java.lang.Override @Override} will help
47 | * ensure that methods are overridden as intended.
48 | *
49 | * WARNING: The {@code TypeVisitor} interface implemented
50 | * by this class may have methods added to it in the future to
51 | * accommodate new, currently unknown, language structures added to
52 | * future versions of the Java™ programming language.
53 | * Therefore, methods whose names begin with {@code "visit"} may be
54 | * added to this class in the future; to avoid incompatibilities,
55 | * classes which extend this class should not declare any instance
56 | * methods with names beginning with {@code "visit"}.
57 | *
58 | * When such a new visit method is added, the default
59 | * implementation in this class will be to call the {@link
60 | * #visitUnknown visitUnknown} method. A new type kind visitor class
61 | * will also be introduced to correspond to the new language level;
62 | * this visitor will have different default behavior for the visit
63 | * method in question. When the new visitor is introduced, all or
64 | * portions of this visitor may be deprecated.
65 | *
66 | * Note that adding a default implementation of a new visit method
67 | * in a visitor class will occur instead of adding a default
68 | * method directly in the visitor interface since a Java SE 8
69 | * language feature cannot be used to this version of the API since
70 | * this version is required to be runnable on Java SE 7
71 | * implementations. Future versions of the API that are only required
72 | * to run on Java SE 8 and later may take advantage of default methods
73 | * in this situation.
74 | *
75 | * @param the type of the additional parameter to this visitor's
78 | * methods. Use {@code Void} for visitors that do not need an
79 | * additional parameter.
80 | *
81 | * @see TypeKindVisitor6
82 | * @see TypeKindVisitor7
83 | * @since 1.8
84 | */
85 | @SupportedSourceVersion(RELEASE_8)
86 | public class TypeKindVisitor8 the type of source objects used by diagnostics received
32 | * by this listener
33 | *
34 | * @author Jonathan Gibbons
35 | * @author Peter von der Ahé
36 | * @since 1.6
37 | */
38 | public interface DiagnosticListener {
39 | /**
40 | * Invoked when a problem is found.
41 | *
42 | * @param diagnostic a diagnostic representing the problem that
43 | * was found
44 | * @throws NullPointerException if the diagnostic argument is
45 | * {@code null} and the implementation cannot handle {@code null}
46 | * arguments
47 | */
48 | void report(Diagnostic extends S> diagnostic);
49 | }
50 |
--------------------------------------------------------------------------------
/library/src/main/java/me/denley/preferencebinder/internal/PrefType.java:
--------------------------------------------------------------------------------
1 | package me.denley.preferencebinder.internal;
2 |
3 | public enum PrefType {
4 | // Defaults are arbitrary as we always check that a value exists
5 | BOOLEAN("boolean", "getBoolean", "false"),
6 | FLOAT("float", "getFloat", "0"),
7 | INTEGER("int", "getInt", "0"),
8 | LONG("long", "getLong", "0"),
9 | STRING("java.lang.String", "getString", "null"),
10 | STRING_SET("java.util.Set
35 | *
41 | *
42 | * @author Joseph D. Darcy
43 | * @author Scott Seligman
44 | * @author Peter von der Ahé
45 | * @see ExecutableElement#getReturnType()
46 | * @since 1.6
47 | */
48 |
49 | public interface NoType extends TypeMirror {
50 | }
51 |
--------------------------------------------------------------------------------
/library/src/main/java/me/denley/preferencebinder/internal/Binding.java:
--------------------------------------------------------------------------------
1 | package me.denley.preferencebinder.internal;
2 |
3 | import java.lang.annotation.ElementType;
4 |
5 | /** A single field or method binding. */
6 | class Binding {
7 |
8 | private final String name;
9 | private final String type;
10 | private final ElementType elementType;
11 | private final WidgetBindingType bindingType;
12 |
13 | public Binding(String name, String type, ElementType elementType, WidgetBindingType bindingType) {
14 | this.name = name;
15 | this.type = type;
16 | this.elementType = elementType;
17 | this.bindingType = bindingType;
18 | }
19 |
20 | /** The name of the field or method */
21 | String getName(){
22 | return name;
23 | }
24 |
25 | /** The fully qualified object type of the field or method parameter (or primative) */
26 | String getType(){
27 | return type;
28 | }
29 |
30 | /** Either ElementType.FIELD or ElementType.METHOD */
31 | ElementType getBindingType(){
32 | return elementType;
33 | }
34 |
35 | WidgetBindingType getWidgetBindingType() {
36 | return bindingType;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 | the type of source objects used by diagnostics received
36 | * by this object
37 | *
38 | * @author Peter von der Ahé
39 | * @since 1.6
40 | */
41 | public final class DiagnosticCollector implements DiagnosticListener {
42 | private List
32 | * ?
33 | * ? extends Number
34 | * ? super T
35 | *
36 | *
37 | *
38 | * Gilad Bracha and David Ungar. Mirrors: Design Principles for
39 | * Meta-level Facilities of Object-Oriented Programming Languages.
40 | * In Proc. of the ACM Conf. on Object-Oriented Programming, Systems,
41 | * Languages and Applications, October 2004.
42 | *
43 | *
44 | * In particular, the model makes a distinction between static
45 | * language constructs, like the {@linkplain javax.lang.model.element
46 | * element} representing {@code java.util.Set}, and the family of
47 | * {@linkplain javax.lang.model.type types} that may be associated
48 | * with an element, like the raw type {@code java.util.Set}, {@code
49 | * java.util.Set
39 | *
40 | * @author Joseph D. Darcy
41 | * @author Scott Seligman
42 | * @author Peter von der Ahé
43 | * @since 1.6
44 | */
45 | public interface AnnotationValue {
46 |
47 | /**
48 | * Returns the value.
49 | *
50 | * @return the value
51 | */
52 | Object getValue();
53 |
54 | /**
55 | * Returns a string representation of this value.
56 | * This is returned in a form suitable for representing this value
57 | * in the source code of an annotation.
58 | *
59 | * @return a string representation of this value
60 | */
61 | String toString();
62 |
63 | /**
64 | * Applies a visitor to this value.
65 | *
66 | * @param
43 | *
72 | *
73 | * @see javax.annotation.PostConstruct
74 | * @see javax.annotation.Resource
75 | * @since Common Annotations 1.0
76 | */
77 |
78 | @Documented
79 | @Retention (RUNTIME)
80 | @Target(METHOD)
81 | public @interface PreDestroy {
82 | }
83 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/tools/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | /**
27 | * Provides interfaces for tools which can be invoked from a program,
28 | * for example, compilers.
29 | *
30 | *
44 | *
73 | * @since Common Annotations 1.0
74 | * @see javax.annotation.PreDestroy
75 | * @see javax.annotation.Resource
76 | */
77 | @Documented
78 | @Retention (RUNTIME)
79 | @Target(METHOD)
80 | public @interface PostConstruct {
81 | }
82 |
--------------------------------------------------------------------------------
/library/src/main/java/javax/lang/model/util/AbstractAnnotationValueVisitor7.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4 | *
5 | *
6 | *
7 | *
8 | *
9 | *
10 | *
11 | *
12 | *
13 | *
14 | *
15 | *
16 | *
17 | *
18 | *
19 | *
20 | *
21 | *
22 | *
23 | *
24 | */
25 |
26 | package javax.lang.model.util;
27 |
28 | import static javax.lang.model.SourceVersion.*;
29 | import javax.lang.model.SourceVersion;
30 | import javax.annotation.processing.SupportedSourceVersion;
31 |
32 | /**
33 | * A skeletal visitor for annotation values with default behavior
34 | * appropriate for the {@link SourceVersion#RELEASE_7 RELEASE_7}
35 | * source version.
36 | *
37 | *
78 | *
79 | * @author Joseph D. Darcy
80 | * @author Scott Seligman
81 | * @author Peter von der Ahé
82 | * @since 1.6
83 | */
84 | public enum NestingKind {
85 | /**
86 | * A top-level type, not contained within another type.
87 | */
88 | TOP_LEVEL,
89 |
90 | /**
91 | * A type that is a named member of another type.
92 | */
93 | MEMBER,
94 |
95 | /**
96 | * A named type declared within a construct other than a type.
97 | */
98 | LOCAL,
99 |
100 | /**
101 | * A type without a name.
102 | */
103 | ANONYMOUS;
104 |
105 | /**
106 | * Does this constant correspond to a nested type element?
107 | * A nested type element is any that is not top-level.
108 | * An inner type element is any nested type element that
109 | * is not {@linkplain Modifier#STATIC static}.
110 | * @return whether or not the constant is nested
111 | */
112 | public boolean isNested() {
113 | return this != TOP_LEVEL;
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/library/src/main/java/me/denley/preferencebinder/internal/WidgetBindingType.java:
--------------------------------------------------------------------------------
1 | package me.denley.preferencebinder.internal;
2 |
3 | public enum WidgetBindingType {
4 |
5 | ASSIGN(
6 | null,
7 | "%s = %s",
8 | null,
9 | null
10 | ),
11 | ACTIVATED(
12 | PrefType.BOOLEAN,
13 | "%s.setActivated(%s)",
14 | null,
15 | null
16 | ),
17 | ENABLED(
18 | PrefType.BOOLEAN,
19 | "%s.setEnabled(%s)",
20 | null,
21 | null
22 | ),
23 | SELECTED(
24 | PrefType.BOOLEAN,
25 | "%s.setSelected(%s)",
26 | null,
27 | null
28 | ),
29 | VISIBILITY(
30 | PrefType.BOOLEAN,
31 | "%s.setVisibility(%s ? android.view.View.VISIBLE : android.view.View.GONE)",
32 | null,
33 | null
34 | ),
35 | CHECKED(
36 | PrefType.BOOLEAN,
37 |
38 | "%s.setChecked(%s)",
39 |
40 | "%s.setOnCheckedChangeListener(new android.widget.CompoundButton.OnCheckedChangeListener() {\n" +
41 | " @Override public void onCheckedChanged(final android.widget.CompoundButton buttonView, final boolean isChecked) {\n" +
42 | " prefs.edit().putBoolean(%s, isChecked).apply();\n" +
43 | " }\n" +
44 | " })",
45 |
46 | "%s.setOnCheckedChangeListener(null)"
47 | ),
48 | TEXT(
49 | PrefType.STRING,
50 | "%s.setText(%s)",
51 | null,
52 | null
53 | ),
54 | PROGRESS(
55 | PrefType.INTEGER,
56 | "%s.setProgress(%s)",
57 | null,
58 | null
59 | ),
60 | SEEKBAR_PROGRESS(
61 | PrefType.INTEGER,
62 |
63 | "%s.setProgress(%s)",
64 |
65 | "%s.setOnSeekBarChangeListener(new android.widget.SeekBar.OnSeekBarChangeListener() {\n" +
66 | " @Override public void onProgressChanged(final android.widget.SeekBar seekBar, final int progress, final boolean fromUser) {\n" +
67 | " prefs.edit().putInt(%s, progress).apply();\n" +
68 | " }\n" +
69 | " @Override public void onStartTrackingTouch(final android.widget.SeekBar seekBar) { }\n" +
70 | " @Override public void onStopTrackingTouch(final android.widget.SeekBar seekBar) { }\n" +
71 | " })",
72 |
73 | "%s.setOnSeekBarChangeListener(null)"
74 | ),
75 | MAX_PROGRESS(
76 | PrefType.INTEGER,
77 | "%s.setMax(%s)",
78 | null,
79 | null
80 | );
81 |
82 | public final PrefType prefType;
83 | public final String bindingCall;
84 | public final String listenerCall;
85 | public final String listenerUnbind;
86 |
87 | WidgetBindingType(PrefType prefType, String bindingCall, String listenerCall, String listenerUnbind) {
88 | this.prefType = prefType;
89 | this.bindingCall = bindingCall;
90 | this.listenerCall = listenerCall;
91 | this.listenerUnbind = listenerUnbind;
92 | }
93 |
94 | }
95 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 | All notable changes to this project will be documented in this file.
3 |
4 | ## 3.1.0 - Unreleased
5 | ### Fixed
6 | - `PreferenceBinder.bind` and `PreferenceBinder.unbind` statement check now looks inside blocks/scopes (e.g. `if` blocks).
7 | - Added `PreferenceBinder.bind(Context context, Object target, SharedPreferences prefs)` to allow testing with mocked `SharedPreferences` files.
8 |
9 | ## 3.0.2 - 2015-08-03
10 | ### Removed
11 | - Removed compiler check for `PreferenceBinder.bind` and `PreferenceBinder.unbind` method calls pending testing and stability improvement to the feature
12 |
13 | ## 3.0.1 - 2015-08-02
14 | ### Fixed
15 | - Fixed NullPointerException when using this library in classes with abstract methods.
16 | - Updated bind/unbind statement checker to look in scopes inside methods.
17 |
18 | ## 3.0.0 - 2015-07-25
19 | ### Changed
20 | - New annotation `@BindPref` replaces both `@InjectPreference` and `@OnPreferenceChanged`. The `listen` flag now defaults to true
21 | - All instances of "inject", "injector", and "injection" have been replaced with "bind", "binding", and "binding".
22 | - `@PreferenceDefault` annotated fields now apply globally (application-wide) rather than just for their containing class.
23 |
24 | ### Added
25 | - `@BindPref` annotation may now be used on certain widget types (fields), to automatically bind the preference value to a widget's method. See README.md for details.
26 | - Compiler now checks for `PreferenceBinder.bind` and `PreferenceBinder.unbind` (when necessary) method calls in classes with `@BindPref` annotations.
27 |
28 | ## 2.2.1 - 2015-03-28
29 | ### Fixed
30 | - Set minSdk to 4, to prevent unnecessary permissions being added by default (see [this reference](https://code.google.com/p/android/issues/detail?id=4101) for explanation)
31 |
32 | ## 2.2.0 - 2015-03-01
33 | ### Added
34 | - Optional "listen" flag for `@InjectPreference` annotation as shorthand for also adding `@OnPreferenceChange` annotation to the same element
35 | - `OnPreferenceChange` annotations on methods can now contain multiple keys (if the method has zero parameters)
36 |
37 | ### Changed
38 | - Method calls now always occur after field updates for any given preference key (for both initialization and updates)
39 | - Annotated methods can now contain zero parameters, to disregard the preference value.
40 |
41 | ## 2.1.1 - 2015-02-25
42 | ### Added
43 | - `PreferenceInjector.bind(Fragment target)` method. The `Context` can be inferred from the `Fragment`.
44 | - `PreferenceInjector.bind(Service target)` method. The `Context` can be inferred from the `Service`.
45 |
46 | ## 2.1.0 - 2015-02-19
47 | ### Added
48 | - `@PreferenceDefault` annotation, to specify injection values when none exists in the `SharedPreferences` file
49 |
50 | ### Fixed
51 | - `String` and `Set
40 | *
41 | * import java.lang.annotation.*;
42 | * import static java.lang.annotation.RetentionPolicy.*;
43 | * import javax.lang.model.element.*;
44 | * import static javax.lang.model.element.NestingKind.*;
45 | *
46 | * @Nesting(TOP_LEVEL)
47 | * public class NestingExamples {
48 | * @Nesting(MEMBER)
49 | * static class MemberClass1{}
50 | *
51 | * @Nesting(MEMBER)
52 | * class MemberClass2{}
53 | *
54 | * public static void main(String... argv) {
55 | * @Nesting(LOCAL)
56 | * class LocalClass{};
57 | *
58 | * Class<?>[] classes = {
59 | * NestingExamples.class,
60 | * MemberClass1.class,
61 | * MemberClass2.class,
62 | * LocalClass.class
63 | * };
64 | *
65 | * for(Class<?> clazz : classes) {
66 | * System.out.format("%s is %s%n",
67 | * clazz.getName(),
68 | * clazz.getAnnotation(Nesting.class).value());
69 | * }
70 | * }
71 | * }
72 | *
73 | * @Retention(RUNTIME)
74 | * @interface Nesting {
75 | * NestingKind value();
76 | * }
77 | *
59 | *
63 | *
64 | * Additionally, synthetic constructs in a class file, such as
65 | * accessor methods used in implementing nested classes and bridge
66 | * methods used in implementing covariant returns, are translation
67 | * artifacts outside of this model.
68 | *
69 | *