Package com.sun.mirror.util

Examples of com.sun.mirror.util.Types


  @NotNull
  private static final ThreadLocal<Types> TYPES = new ThreadLocal<Types>();

  @NotNull
  public static Types getTypes() {
    Types resolved = TYPES.get();
    if ( resolved == null ) {
      throw new IllegalStateException( "No types object found!" );
    }
    return resolved;
  }
View Full Code Here


    public boolean isRemote(TypeDeclaration typeDecl) {
        return isSubtype(typeDecl, remoteDecl);
    }

    public static boolean isSubtype(AnnotationProcessorEnvironment env, TypeDeclaration d1, TypeDeclaration d2) {
        Types typeUtils = env.getTypeUtils();
        return typeUtils.isSubtype(typeUtils.getDeclaredType(d1),typeUtils.getDeclaredType(d2));
    }
View Full Code Here

    public TypeDeclaration asDecl(Class c) {
        return env.getTypeDeclaration(getSourceClassName(c));
    }

    public <T> TypeMirror erasure(TypeMirror t) {
        Types tu = env.getTypeUtils();
        t = tu.getErasure(t);
        if(t instanceof DeclaredType) {
            DeclaredType dt = (DeclaredType)t;
            if(!dt.getActualTypeArguments().isEmpty())
            return tu.getDeclaredType(dt.getDeclaration());
        }
        return t;
    }
View Full Code Here

    private static final Context.Key<Types> typesKey =
            new Context.Key<Types>();

    public static Types instance(Context context) {
        Types instance = context.get(typesKey);
        if (instance == null) {
            instance = new TypesImpl(context);
        }
        return instance;
    }
View Full Code Here

  @NotNull
  private static final ThreadLocal<Types> TYPES = new ThreadLocal<Types>();

  @NotNull
  public static Types getTypes() {
    Types resolved = TYPES.get();
    if ( resolved == null ) {
      throw new IllegalStateException( "No types object found!" );
    }
    return resolved;
  }
View Full Code Here

  @Nonnull
  private static final ThreadLocal<Types> TYPES = new ThreadLocal<Types>();

  @Nonnull
  public static Types getTypes() {
    Types resolved = TYPES.get();
    if ( resolved == null ) {
      throw new IllegalStateException( "No types object found!" );
    }
    return resolved;
  }
View Full Code Here

            env.getMessager().printError(clz.getPosition(),e.toString());
        }
    }

    private boolean isSubType(TypeDeclaration subType, TypeDeclaration baseType) {
        Types u = env.getTypeUtils();
        return u.isSubtype(u.getDeclaredType(subType),u.getDeclaredType(baseType));
    }
View Full Code Here

    public boolean isRemote(TypeDeclaration typeDecl) {
        return isSubtype(typeDecl, remoteDecl);
    }

    public static boolean isSubtype(AnnotationProcessorEnvironment env, TypeDeclaration d1, TypeDeclaration d2) {
        Types typeUtils = env.getTypeUtils();
        return typeUtils.isSubtype(typeUtils.getDeclaredType(d1),typeUtils.getDeclaredType(d2));
    }
View Full Code Here

    public TypeDeclaration asDecl(Class c) {
        return env.getTypeDeclaration(getSourceClassName(c));
    }

    public <T> TypeMirror erasure(TypeMirror t) {
        Types tu = env.getTypeUtils();
        t = tu.getErasure(t);
        if(t instanceof DeclaredType) {
            DeclaredType dt = (DeclaredType)t;
            if(!dt.getActualTypeArguments().isEmpty())
            return tu.getDeclaredType(dt.getDeclaration());
        }
        return t;
    }
View Full Code Here

  @NotNull
  private static final ThreadLocal<Types> TYPES = new ThreadLocal<Types>();

  @NotNull
  public static Types getTypes() {
    Types resolved = TYPES.get();
    if ( resolved == null ) {
      throw new IllegalStateException( "No types object found!" );
    }
    return resolved;
  }
View Full Code Here

TOP

Related Classes of com.sun.mirror.util.Types

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.