Enum ImportPolicy

All Implemented Interfaces:
Serializable, Comparable<ImportPolicy>, java.lang.constant.Constable

public enum ImportPolicy extends Enum<ImportPolicy>
Policy specifying when and how to import classes when inlining types.
Louis Wasserman
  • Enum Constant Details


      public static final ImportPolicy IMPORT_TOP_LEVEL
      Import the outermost class and explicitly qualify references below that. For example, to reference com.google.Foo.Bar, we import com.google.Foo and explicitly qualify Foo.Bar.

      public static final ImportPolicy IMPORT_CLASS_DIRECTLY
      Import nested classes directly, and qualify static references from the class level.

      public static final ImportPolicy STATIC_IMPORT_ALWAYS
      When inlining static methods, always static import the method. Non-static references to classes are imported from the top level as in IMPORT_TOP_LEVEL.
  • Method Details

    • values

      public static ImportPolicy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ImportPolicy valueOf(String name)
      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.)
      name - the name of the enum constant to be returned.
      the enum constant with the specified name
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • bind

      public static void bind(com.sun.tools.javac.util.Context context, ImportPolicy policy)
    • instance

      public static ImportPolicy instance(com.sun.tools.javac.util.Context context)
    • 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)