src/share/classes/com/sun/tools/apt/mirror/type/TypeMaker.java

Print this page




  24  */
  25 
  26 package com.sun.tools.apt.mirror.type;
  27 
  28 
  29 import java.util.Collection;
  30 import java.util.ArrayList;
  31 
  32 import com.sun.mirror.type.*;
  33 import com.sun.mirror.type.PrimitiveType.Kind;
  34 import com.sun.tools.apt.mirror.AptEnv;
  35 import com.sun.tools.javac.code.*;
  36 import com.sun.tools.javac.util.Context;
  37 
  38 import static com.sun.tools.javac.code.TypeTags.*;
  39 
  40 
  41 /**
  42  * Utilities for constructing type objects.
  43  */
  44 
  45 public class TypeMaker {
  46 
  47     private final AptEnv env;
  48     private final VoidType voidType;
  49     private PrimitiveType[] primTypes = new PrimitiveType[VOID];
  50                                                 // VOID is past all prim types
  51 
  52 
  53     private static final Context.Key<TypeMaker> typeMakerKey =
  54             new Context.Key<TypeMaker>();
  55 
  56     public static TypeMaker instance(Context context) {
  57         TypeMaker instance = context.get(typeMakerKey);
  58         if (instance == null) {
  59             instance = new TypeMaker(context);
  60         }
  61         return instance;
  62     }
  63 
  64     private TypeMaker(Context context) {




  24  */
  25 
  26 package com.sun.tools.apt.mirror.type;
  27 
  28 
  29 import java.util.Collection;
  30 import java.util.ArrayList;
  31 
  32 import com.sun.mirror.type.*;
  33 import com.sun.mirror.type.PrimitiveType.Kind;
  34 import com.sun.tools.apt.mirror.AptEnv;
  35 import com.sun.tools.javac.code.*;
  36 import com.sun.tools.javac.util.Context;
  37 
  38 import static com.sun.tools.javac.code.TypeTags.*;
  39 
  40 
  41 /**
  42  * Utilities for constructing type objects.
  43  */
  44 @SuppressWarnings("deprecation")
  45 public class TypeMaker {
  46 
  47     private final AptEnv env;
  48     private final VoidType voidType;
  49     private PrimitiveType[] primTypes = new PrimitiveType[VOID];
  50                                                 // VOID is past all prim types
  51 
  52 
  53     private static final Context.Key<TypeMaker> typeMakerKey =
  54             new Context.Key<TypeMaker>();
  55 
  56     public static TypeMaker instance(Context context) {
  57         TypeMaker instance = context.get(typeMakerKey);
  58         if (instance == null) {
  59             instance = new TypeMaker(context);
  60         }
  61         return instance;
  62     }
  63 
  64     private TypeMaker(Context context) {