< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Directive.java

Print this page




  36 import com.sun.tools.javac.code.Symbol.ClassSymbol;
  37 import com.sun.tools.javac.code.Symbol.ModuleSymbol;
  38 import com.sun.tools.javac.code.Symbol.PackageSymbol;
  39 import com.sun.tools.javac.util.DefinedBy;
  40 import com.sun.tools.javac.util.DefinedBy.Api;
  41 import com.sun.tools.javac.util.List;
  42 
  43 
  44 /**
  45  *  Root class for the directives that may appear in module compilation units.
  46  *
  47  *  <p><b>This is NOT part of any supported API.
  48  *  If you write code that depends on this, you do so at your own risk.
  49  *  This code and its internal interfaces are subject to change or
  50  *  deletion without notice.</b>
  51  */
  52 public abstract class Directive implements ModuleElement.Directive {
  53 
  54     /** Flags for RequiresDirective. */
  55     public enum RequiresFlag {
  56         TRANSITIVE(0x0010),
  57         STATIC_PHASE(0x0020),
  58         SYNTHETIC(0x1000),
  59         MANDATED(0x8000),
  60         EXTRA(0x10000);
  61 
  62         // overkill? move to ClassWriter?
  63         public static int value(Set<RequiresFlag> s) {
  64             int v = 0;
  65             for (RequiresFlag f: s)
  66                 v |= f.value;
  67             return v;
  68         }
  69 
  70         RequiresFlag(int value) {
  71             this.value = value;
  72         }
  73 
  74         public final int value;
  75     }
  76 
  77     /** Flags for ExportsDirective. */




  36 import com.sun.tools.javac.code.Symbol.ClassSymbol;
  37 import com.sun.tools.javac.code.Symbol.ModuleSymbol;
  38 import com.sun.tools.javac.code.Symbol.PackageSymbol;
  39 import com.sun.tools.javac.util.DefinedBy;
  40 import com.sun.tools.javac.util.DefinedBy.Api;
  41 import com.sun.tools.javac.util.List;
  42 
  43 
  44 /**
  45  *  Root class for the directives that may appear in module compilation units.
  46  *
  47  *  <p><b>This is NOT part of any supported API.
  48  *  If you write code that depends on this, you do so at your own risk.
  49  *  This code and its internal interfaces are subject to change or
  50  *  deletion without notice.</b>
  51  */
  52 public abstract class Directive implements ModuleElement.Directive {
  53 
  54     /** Flags for RequiresDirective. */
  55     public enum RequiresFlag {
  56         TRANSITIVE(0x0020),
  57         STATIC_PHASE(0x0040),
  58         SYNTHETIC(0x1000),
  59         MANDATED(0x8000),
  60         EXTRA(0x10000);
  61 
  62         // overkill? move to ClassWriter?
  63         public static int value(Set<RequiresFlag> s) {
  64             int v = 0;
  65             for (RequiresFlag f: s)
  66                 v |= f.value;
  67             return v;
  68         }
  69 
  70         RequiresFlag(int value) {
  71             this.value = value;
  72         }
  73 
  74         public final int value;
  75     }
  76 
  77     /** Flags for ExportsDirective. */


< prev index next >