Enum ImportPolicy
- All Implemented Interfaces:
Serializable
,Comparable<ImportPolicy>
,java.lang.constant.Constable
Policy specifying when and how to import classes when inlining types.
- Author:
- Louis Wasserman
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionImport nested classes directly, and qualify static references from the class level.Import the outermost class and explicitly qualify references below that.When inlining static methods, always static import the method. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
bind
(com.sun.tools.javac.util.Context context, ImportPolicy policy) abstract com.sun.tools.javac.tree.JCTree.JCExpression
classReference
(Inliner inliner, CharSequence topLevelClazz, CharSequence fullyQualifiedClazz) static ImportPolicy
instance
(com.sun.tools.javac.util.Context context) abstract com.sun.tools.javac.tree.JCTree.JCExpression
staticReference
(Inliner inliner, CharSequence topLevelClazz, CharSequence fullyQualifiedClazz, CharSequence member) static ImportPolicy
Returns the enum constant of this type with the specified name.static ImportPolicy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
IMPORT_TOP_LEVEL
Import the outermost class and explicitly qualify references below that. For example, to referencecom.google.Foo.Bar
, we importcom.google.Foo
and explicitly qualifyFoo.Bar
. -
IMPORT_CLASS_DIRECTLY
Import nested classes directly, and qualify static references from the class level. -
STATIC_IMPORT_ALWAYS
When inlining static methods, always static import the method. Non-static references to classes are imported from the top level as inIMPORT_TOP_LEVEL
.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
bind
-
instance
-
classReference
public abstract com.sun.tools.javac.tree.JCTree.JCExpression classReference(Inliner inliner, CharSequence topLevelClazz, CharSequence fullyQualifiedClazz) -
staticReference
public abstract com.sun.tools.javac.tree.JCTree.JCExpression staticReference(Inliner inliner, CharSequence topLevelClazz, CharSequence fullyQualifiedClazz, CharSequence member)
-