com.sun.tools.javac.code.Types.asOuterSuper()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中com.sun.tools.javac.code.Types.asOuterSuper()方法的一些代码示例,展示了Types.asOuterSuper()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Types.asOuterSuper()方法的具体详情如下:
包路径:com.sun.tools.javac.code.Types
类名称:Types
方法名:asOuterSuper

Types.asOuterSuper介绍

[英]Return the base type of t or any of its outer types that starts with the given symbol. If none exists, return null.
[中]返回t的基类型或以给定符号开头的任何外部类型。如果不存在,则返回null。

代码示例

代码示例来源:origin: sc.fiji/javac

public String location(Type site, Types types) {
  if (owner.name == null || owner.name.len == 0) {
    return location();
  }
  if (owner.type.tag == CLASS) {
    Type ownertype = types.asOuterSuper(site, owner);
    if (ownertype != null) return ownertype.toString();
  }
  return owner.toString();
}

代码示例来源:origin: org.jvnet.sorcerer/sorcerer-javac

public String location(Type site, Types types) {
  if (owner.name == null || owner.name.len == 0) {
    return location();
  }
  if (owner.type.tag == CLASS) {
    Type ownertype = types.asOuterSuper(site, owner);
    if (ownertype != null) return ownertype.toString();
  }
  return owner.toString();
}

代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac

public Symbol location(Type site, Types types) {
  if (owner.name == null || owner.name.isEmpty()) {
    return location();
  }
  if (owner.type.hasTag(CLASS)) {
    Type ownertype = types.asOuterSuper(site, owner);
    if (ownertype != null) return ownertype.tsym;
  }
  return owner;
}

代码示例来源:origin: konsoletyper/teavm-javac

public Symbol location(Type site, Types types) {
  if (owner.name == null || owner.name.isEmpty()) {
    return location();
  }
  if (owner.type.hasTag(CLASS)) {
    Type ownertype = types.asOuterSuper(site, owner);
    if (ownertype != null) return ownertype.tsym;
  }
  return owner;
}

代码示例来源:origin: sc.fiji/javac

@Override
public Type visitClassType(ClassType t, Symbol sym) {
  Symbol owner = sym.owner;
  long flags = sym.flags();
  if (((flags & STATIC) == 0) && owner.type.isParameterized()) {
    Type base = asOuterSuper(t, owner);
    if (base != null) {
      List<Type> ownerParams = owner.type.allparams();
      List<Type> baseParams = base.allparams();
      if (ownerParams.nonEmpty()) {
        if (baseParams.isEmpty()) {
          // then base is a raw type
          return erasure(sym.type);
        } else {
          return subst(sym.type, ownerParams, baseParams);
        }
      }
    }
  }
  return sym.type;
}

代码示例来源:origin: org.jvnet.sorcerer/sorcerer-javac

@Override
public Type visitClassType(ClassType t, Symbol sym) {
  Symbol owner = sym.owner;
  long flags = sym.flags();
  if (((flags & STATIC) == 0) && owner.type.isParameterized()) {
    Type base = asOuterSuper(t, owner);
    if (base != null) {
      List<Type> ownerParams = owner.type.allparams();
      List<Type> baseParams = base.allparams();
      if (ownerParams.nonEmpty()) {
        if (baseParams.isEmpty()) {
          // then base is a raw type
          return erasure(sym.type);
        } else {
          return subst(sym.type, ownerParams, baseParams);
        }
      }
    }
  }
  return sym.type;
}

代码示例来源:origin: konsoletyper/teavm-javac

@Override
public Type visitClassType(ClassType t, Symbol sym) {
  Symbol owner = sym.owner;
  long flags = sym.flags();
  if (((flags & STATIC) == 0) && owner.type.isParameterized()) {
    Type base = asOuterSuper(t, owner);
    //if t is an intersection type T = CT & I1 & I2 ... & In
    //its supertypes CT, I1, ... In might contain wildcards
    //so we need to go through capture conversion
    base = t.isCompound() ? capture(base) : base;
    if (base != null) {
      List<Type> ownerParams = owner.type.allparams();
      List<Type> baseParams = base.allparams();
      if (ownerParams.nonEmpty()) {
        if (baseParams.isEmpty()) {
          // then base is a raw type
          return erasure(sym.type);
        } else {
          return subst(sym.type, ownerParams, baseParams);
        }
      }
    }
  }
  return sym.type;
}

代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac

@Override
public Type visitClassType(ClassType t, Symbol sym) {
  Symbol owner = sym.owner;
  long flags = sym.flags();
  if (((flags & STATIC) == 0) && owner.type.isParameterized()) {
    Type base = asOuterSuper(t, owner);
    //if t is an intersection type T = CT & I1 & I2 ... & In
    //its supertypes CT, I1, ... In might contain wildcards
    //so we need to go through capture conversion
    base = t.isCompound() ? capture(base) : base;
    if (base != null) {
      List<Type> ownerParams = owner.type.allparams();
      List<Type> baseParams = base.allparams();
      if (ownerParams.nonEmpty()) {
        if (baseParams.isEmpty()) {
          // then base is a raw type
          return erasure(sym.type);
        } else {
          return subst(sym.type, ownerParams, baseParams);
        }
      }
    }
  }
  return sym.type;
}

代码示例来源:origin: org.jvnet.sorcerer/sorcerer-javac

if (clazzOuter.tag == CLASS && site != clazzOuter) {
  if (site.tag == CLASS)
    site = types.asOuterSuper(site, clazzOuter.tsym);
  if (site == null)
    site = types.erasure(clazzOuter);

代码示例来源:origin: sc.fiji/javac

if (clazzOuter.tag == CLASS && site != clazzOuter) {
  if (site.tag == CLASS)
    site = types.asOuterSuper(site, clazzOuter.tsym);
  if (site == null)
    site = types.erasure(clazzOuter);

代码示例来源:origin: konsoletyper/teavm-javac

if (clazzOuter.hasTag(CLASS) && site != clazzOuter) {
  if (site.hasTag(CLASS))
    site = types.asOuterSuper(site, clazzOuter.tsym);
  if (site == null)
    site = types.erasure(clazzOuter);

代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac

if (clazzOuter.hasTag(CLASS) && site != clazzOuter) {
  if (site.hasTag(CLASS))
    site = types.asOuterSuper(site, clazzOuter.tsym);
  if (site == null)
    site = types.erasure(clazzOuter);

代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac

(v.flags() & STATIC) == 0 &&
(site.hasTag(CLASS) || site.hasTag(TYPEVAR))) {
Type s = types.asOuterSuper(site, v.owner);
if (s != null &&
  s.isRaw() &&

代码示例来源:origin: org.jvnet.sorcerer/sorcerer-javac

(v.flags() & STATIC) == 0 &&
(site.tag == CLASS || site.tag == TYPEVAR)) {
Type s = types.asOuterSuper(site, v.owner);
if (s != null &&
  s.isRaw() &&

代码示例来源:origin: sc.fiji/javac

(v.flags() & STATIC) == 0 &&
(site.tag == CLASS || site.tag == TYPEVAR)) {
Type s = types.asOuterSuper(site, v.owner);
if (s != null &&
  s.isRaw() &&

代码示例来源:origin: konsoletyper/teavm-javac

(v.flags() & STATIC) == 0 &&
(site.hasTag(CLASS) || site.hasTag(TYPEVAR))) {
Type s = types.asOuterSuper(site, v.owner);
if (s != null &&
  s.isRaw() &&

代码示例来源:origin: org.jvnet.sorcerer/sorcerer-javac

(sym.flags() & STATIC) == 0 &&
(site.tag == CLASS || site.tag == TYPEVAR)) {
Type s = types.asOuterSuper(site, sym.owner);
if (s != null && s.isRaw() &&
  !types.isSameTypes(sym.type.getParameterTypes(),

代码示例来源:origin: sc.fiji/javac

(sym.flags() & STATIC) == 0 &&
(site.tag == CLASS || site.tag == TYPEVAR)) {
Type s = types.asOuterSuper(site, sym.owner);
if (s != null && s.isRaw() &&
  !types.isSameTypes(sym.type.getParameterTypes(),

代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac

(sym.flags() & STATIC) == 0 &&
(site.hasTag(CLASS) || site.hasTag(TYPEVAR))) {
Type s = types.asOuterSuper(site, sym.owner);
if (s != null && s.isRaw() &&
  !types.isSameTypes(sym.type.getParameterTypes(),

代码示例来源:origin: konsoletyper/teavm-javac

(sym.flags() & STATIC) == 0 &&
(site.hasTag(CLASS) || site.hasTag(TYPEVAR))) {
Type s = types.asOuterSuper(site, sym.owner);
if (s != null && s.isRaw() &&
  !types.isSameTypes(sym.type.getParameterTypes(),

相关文章

Types类方法