本文整理了Java中com.sun.tools.javac.code.Types.memberType()
方法的一些代码示例,展示了Types.memberType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Types.memberType()
方法的具体详情如下:
包路径:com.sun.tools.javac.code.Types
类名称:Types
方法名:memberType
[英]The type of given symbol, seen as a member of t.
[中]给定符号的类型,被视为t的一个成员。
代码示例来源:origin: google/error-prone
Type varType = state.getTypes().memberType(classType, var);
Violation info =
threadSafety.isThreadSafeType(
代码示例来源:origin: sc.fiji/javac
@Override
public Type visitTypeVar(TypeVar t, Symbol sym) {
return memberType(t.bound, sym);
}
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
@Override
public Type visitTypeVar(TypeVar t, Symbol sym) {
return memberType(t.bound, sym);
}
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
public Symbol asMemberOf(Type site, Types types) {
return new VarSymbol(flags_field, name, types.memberType(site, this), owner);
}
代码示例来源:origin: konsoletyper/teavm-javac
@Override
public Type visitWildcardType(WildcardType t, Symbol sym) {
return memberType(wildUpperBound(t), sym);
}
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
public boolean accepts(Symbol s) {
return s.kind == Kinds.MTH &&
s.name == msym.name &&
(s.flags() & SYNTHETIC) == 0 &&
s.isInheritedIn(site.tsym, Types.this) &&
overrideEquivalent(memberType(site, s), memberType(site, msym));
}
};
代码示例来源:origin: konsoletyper/teavm-javac
public boolean accepts(Symbol s) {
return s.kind == Kinds.MTH &&
s.name == msym.name &&
(s.flags() & SYNTHETIC) == 0 &&
s.isInheritedIn(site.tsym, Types.this) &&
overrideEquivalent(memberType(site, s), memberType(site, msym));
}
};
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
@Override
public Type getType(Type origin) {
Type mt = memberType(origin, getSymbol());
return createMethodTypeWithThrown(mt, thrown1);
}
};
代码示例来源:origin: org.jvnet.sorcerer/sorcerer-javac
/**
* Lookup the method as a member of the type. Compare the
* erasures.
* @param type the class where to look for the method
* @param method the method to look for in class
* @param erasure the erasure of method
*/
private boolean isSameMemberWhenErased(Type type,
MethodSymbol method,
Type erasure) {
return types.isSameType(erasure(types.memberType(type, method)),
erasure);
}
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
/**
* Lookup the method as a member of the type. Compare the
* erasures.
* @param type the class where to look for the method
* @param method the method to look for in class
* @param erasure the erasure of method
*/
private boolean isSameMemberWhenErased(Type type,
MethodSymbol method,
Type erasure) {
return types.isSameType(erasure(types.memberType(type, method)),
erasure);
}
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
private boolean notOverriddenIn(Type site, Symbol sym) {
if (sym.kind != MTH || sym.isConstructor() || sym.isStatic())
return true;
else {
Symbol s2 = ((MethodSymbol)sym).implementation(site.tsym, types, true);
return (s2 == null || s2 == sym || sym.owner == s2.owner ||
!types.isSubSignature(types.memberType(site, s2), types.memberType(site, sym)));
}
}
//where
代码示例来源:origin: konsoletyper/teavm-javac
private boolean notOverriddenIn(Type site, Symbol sym) {
if (sym.kind != MTH || sym.isConstructor() || sym.isStatic())
return true;
else {
Symbol s2 = ((MethodSymbol)sym).implementation(site.tsym, types, true);
return (s2 == null || s2 == sym || sym.owner == s2.owner ||
!types.isSubSignature(types.memberType(site, s2), types.memberType(site, sym)));
}
}
//where
代码示例来源:origin: sc.fiji/javac
/**
* Lookup the method as a member of the type. Compare the
* erasures.
* @param type the class where to look for the method
* @param method the method to look for in class
* @param erasure the erasure of method
*/
private boolean isSameMemberWhenErased(Type type,
MethodSymbol method,
Type erasure) {
return types.isSameType(erasure(types.memberType(type, method)),
erasure);
}
代码示例来源:origin: konsoletyper/teavm-javac
@Override
public Type getType(Type origin) {
Type mt = memberType(origin, getSymbol());
return createMethodTypeWithThrown(mt, thrown1);
}
};
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
private void adjustAbstractMethod(ClassSymbol c,
MethodSymbol pm,
MethodSymbol im) {
MethodType pmt = (MethodType)pm.type;
Type imt = types.memberType(c.type, im);
pmt.thrown = chk.intersect(pmt.getThrownTypes(), imt.getThrownTypes());
}
代码示例来源:origin: org.jvnet.sorcerer/sorcerer-javac
private void adjustAbstractMethod(ClassSymbol c,
MethodSymbol pm,
MethodSymbol im) {
MethodType pmt = (MethodType)pm.type;
Type imt = types.memberType(c.type, im);
pmt.thrown = chk.intersect(pmt.getThrownTypes(), imt.getThrownTypes());
}
代码示例来源:origin: sc.fiji/javac
private void adjustAbstractMethod(ClassSymbol c,
MethodSymbol pm,
MethodSymbol im) {
MethodType pmt = (MethodType)pm.type;
Type imt = types.memberType(c.type, im);
pmt.thrown = chk.intersect(pmt.getThrownTypes(), imt.getThrownTypes());
}
代码示例来源:origin: konsoletyper/teavm-javac
private void adjustAbstractMethod(ClassSymbol c,
MethodSymbol pm,
MethodSymbol im) {
MethodType pmt = (MethodType)pm.type;
Type imt = types.memberType(c.type, im);
pmt.thrown = chk.intersect(pmt.getThrownTypes(), imt.getThrownTypes());
}
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
public Type getType(Type site) {
site = removeWildcards(site);
if (!chk.checkValidGenericType(site)) {
//if the inferred functional interface type is not well-formed,
//or if it's not a subtype of the original target, issue an error
throw failure(diags.fragment("no.suitable.functional.intf.inst", site));
}
return memberType(site, descSym);
}
}
代码示例来源:origin: konsoletyper/teavm-javac
public Type getType(Type site) {
site = removeWildcards(site);
if (!chk.checkValidGenericType(site)) {
//if the inferred functional interface type is not well-formed,
//or if it's not a subtype of the original target, issue an error
throw failure(diags.fragment("no.suitable.functional.intf.inst", site));
}
return memberType(site, descSym);
}
}
内容来源于网络,如有侵权,请联系作者删除!