本文整理了Java中com.sun.tools.javac.code.Type.annotatedType()
方法的一些代码示例,展示了Type.annotatedType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Type.annotatedType()
方法的具体详情如下:
包路径:com.sun.tools.javac.code.Type
类名称:Type
方法名:annotatedType
暂无
代码示例来源:origin: konsoletyper/teavm-javac
@Override
public Type visitAnnotatedType(AnnotatedType t, Boolean recurse) {
Type erased = erasure(t.unannotatedType(), recurse);
if (erased.isAnnotated()) {
// This can only happen when the underlying type is a
// type variable and the upper bound of it is annotated.
// The annotation on the type variable overrides the one
// on the bound.
erased = ((AnnotatedType)erased).unannotatedType();
}
return erased.annotatedType(t.getAnnotationMirrors());
}
};
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
@Override
public Type visitAnnotatedType(AnnotatedType t, Boolean recurse) {
Type erased = erasure(t.unannotatedType(), recurse);
if (erased.isAnnotated()) {
// This can only happen when the underlying type is a
// type variable and the upper bound of it is annotated.
// The annotation on the type variable overrides the one
// on the bound.
erased = ((AnnotatedType)erased).unannotatedType();
}
return erased.annotatedType(t.getAnnotationMirrors());
}
};
代码示例来源:origin: konsoletyper/teavm-javac
public void visitAnnotatedType(JCAnnotatedType tree) {
// No need to retain type annotations in the tree
// tree.annotations = translate(tree.annotations);
tree.annotations = List.nil();
tree.underlyingType = translate(tree.underlyingType);
// but maintain type annotations in the type.
if (tree.type.isAnnotated()) {
tree.type = tree.underlyingType.type.unannotatedType().annotatedType(tree.type.getAnnotationMirrors());
} else if (tree.underlyingType.type.isAnnotated()) {
tree.type = tree.underlyingType.type;
}
result = tree;
}
代码示例来源:origin: org.kohsuke.sorcerer/sorcerer-javac
public void visitAnnotatedType(JCAnnotatedType tree) {
// No need to retain type annotations in the tree
// tree.annotations = translate(tree.annotations);
tree.annotations = List.nil();
tree.underlyingType = translate(tree.underlyingType);
// but maintain type annotations in the type.
if (tree.type.isAnnotated()) {
tree.type = tree.underlyingType.type.unannotatedType().annotatedType(tree.type.getAnnotationMirrors());
} else if (tree.underlyingType.type.isAnnotated()) {
tree.type = tree.underlyingType.type;
}
result = tree;
}
内容来源于网络,如有侵权,请联系作者删除!