本文整理汇总了Java中com.sun.tools.javac.code.TargetType类的典型用法代码示例。如果您正苦于以下问题:Java TargetType类的具体用法?Java TargetType怎么用?Java TargetType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TargetType类属于com.sun.tools.javac.code包,在下文中一共展示了TargetType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: methodReturnTAPosition
import com.sun.tools.javac.code.TargetType; //导入依赖的package包/类
public static TypeAnnotationPosition methodReturnTAPosition(SourceVersion ver, final int pos) {
return call8or9(ver,
new TAPCall() {
@Override
public TypeAnnotationPosition call8(Object ... p) throws InstantiationException, IllegalAccessException, IllegalArgumentException, NoSuchFieldException, SecurityException {
TypeAnnotationPosition tapos = TypeAnnotationPosition.class.newInstance();
TypeAnnotationPosition.class.getField("type").set(tapos, TargetType.METHOD_RETURN);
TypeAnnotationPosition.class.getField("pos").set(tapos, pos);
return tapos;
}
@Override
public TypeAnnotationPosition call9(Object... param) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
return (TypeAnnotationPosition) TypeAnnotationPosition.class
.getMethod("methodReturn", int.class)
.invoke(null, pos);
}
}
);
}
示例2: methodReceiverTAPosition
import com.sun.tools.javac.code.TargetType; //导入依赖的package包/类
public static TypeAnnotationPosition methodReceiverTAPosition(SourceVersion ver, final int pos) {
return call8or9(ver,
new TAPCall() {
@Override
public TypeAnnotationPosition call8(Object ... p) throws InstantiationException, IllegalAccessException, IllegalArgumentException, NoSuchFieldException, SecurityException {
TypeAnnotationPosition tapos = TypeAnnotationPosition.class.newInstance();
TypeAnnotationPosition.class.getField("type").set(tapos, TargetType.METHOD_RECEIVER);
TypeAnnotationPosition.class.getField("pos").set(tapos, pos);
return tapos;
}
@Override
public TypeAnnotationPosition call9(Object... param) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
return (TypeAnnotationPosition) TypeAnnotationPosition.class
.getMethod("methodReceiver", int.class)
.invoke(null, pos);
}
}
);
}
示例3: methodParameterTAPosition
import com.sun.tools.javac.code.TargetType; //导入依赖的package包/类
public static TypeAnnotationPosition methodParameterTAPosition(SourceVersion ver, final int pidx, final int pos) {
return call8or9(ver,
new TAPCall() {
@Override
public TypeAnnotationPosition call8(Object ... p) throws InstantiationException, IllegalAccessException, IllegalArgumentException, NoSuchFieldException, SecurityException {
TypeAnnotationPosition tapos = TypeAnnotationPosition.class.newInstance();
TypeAnnotationPosition.class.getField("type").set(tapos, TargetType.METHOD_FORMAL_PARAMETER);
TypeAnnotationPosition.class.getField("parameter_index").set(tapos, pidx);
TypeAnnotationPosition.class.getField("pos").set(tapos, pos);
return tapos;
}
@Override
public TypeAnnotationPosition call9(Object... param) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
return (TypeAnnotationPosition) TypeAnnotationPosition.class
.getMethod("methodParameter", int.class, int.class)
.invoke(null, pidx, pos);
}
}
);
}
示例4: methodThrowsTAPosition
import com.sun.tools.javac.code.TargetType; //导入依赖的package包/类
public static TypeAnnotationPosition methodThrowsTAPosition(SourceVersion ver, final int tidx, final int pos) {
return call8or9(ver,
new TAPCall() {
@Override
public TypeAnnotationPosition call8(Object ... p) throws InstantiationException, IllegalAccessException, IllegalArgumentException, NoSuchFieldException, SecurityException {
TypeAnnotationPosition tapos = TypeAnnotationPosition.class.newInstance();
TypeAnnotationPosition.class.getField("type").set(tapos, TargetType.THROWS);
TypeAnnotationPosition.class.getField("type_index").set(tapos, tidx);
TypeAnnotationPosition.class.getField("pos").set(tapos, pos);
return tapos;
}
@Override
public TypeAnnotationPosition call9(Object... param) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, NoSuchFieldException {
return (TypeAnnotationPosition) TypeAnnotationPosition.class
.getMethod("methodThrows", List.class, JCLambda.class, int.class, int.class)
.invoke(null, TypeAnnotationPosition.class.getField("emptyPath").get(null), null, tidx, pos);
}
}
);
}
示例5: fieldTAPosition
import com.sun.tools.javac.code.TargetType; //导入依赖的package包/类
public static TypeAnnotationPosition fieldTAPosition(SourceVersion ver, final int pos) {
return call8or9(ver,
new TAPCall() {
@Override
public TypeAnnotationPosition call8(Object ... p) throws InstantiationException, IllegalAccessException, IllegalArgumentException, NoSuchFieldException, SecurityException {
TypeAnnotationPosition tapos = TypeAnnotationPosition.class.newInstance();
TypeAnnotationPosition.class.getField("type").set(tapos, TargetType.FIELD);
TypeAnnotationPosition.class.getField("pos").set(tapos, pos);
return tapos;
}
@Override
public TypeAnnotationPosition call9(Object... param) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
return (TypeAnnotationPosition) TypeAnnotationPosition.class
.getMethod("field", int.class)
.invoke(null, pos);
}
}
);
}
示例6: classExtendsTAPosition
import com.sun.tools.javac.code.TargetType; //导入依赖的package包/类
public static TypeAnnotationPosition classExtendsTAPosition(SourceVersion ver, final int implidx, final int pos) {
return call8or9(ver,
new TAPCall() {
@Override
public TypeAnnotationPosition call8(Object ... p) throws InstantiationException, IllegalAccessException, IllegalArgumentException, NoSuchFieldException, SecurityException {
TypeAnnotationPosition tapos = TypeAnnotationPosition.class.newInstance();
TypeAnnotationPosition.class.getField("type").set(tapos, TargetType.CLASS_EXTENDS);
TypeAnnotationPosition.class.getField("type_index").set(tapos, implidx);
TypeAnnotationPosition.class.getField("pos").set(tapos, pos);
return tapos;
}
@Override
public TypeAnnotationPosition call9(Object... param) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
return (TypeAnnotationPosition) TypeAnnotationPosition.class
.getMethod("classExtends", int.class, int.class)
.invoke(null, implidx, pos);
}
}
);
}
示例7: typeParameterTAPosition
import com.sun.tools.javac.code.TargetType; //导入依赖的package包/类
public static TypeAnnotationPosition typeParameterTAPosition(SourceVersion ver, final int tpidx, final int pos) {
return call8or9(ver,
new TAPCall() {
@Override
public TypeAnnotationPosition call8(Object ... p) throws InstantiationException, IllegalAccessException, IllegalArgumentException, NoSuchFieldException, SecurityException {
TypeAnnotationPosition tapos = TypeAnnotationPosition.class.newInstance();
TypeAnnotationPosition.class.getField("type").set(tapos, TargetType.CLASS_TYPE_PARAMETER);
TypeAnnotationPosition.class.getField("parameter_index").set(tapos, tpidx);
TypeAnnotationPosition.class.getField("pos").set(tapos, pos);
return tapos;
}
@Override
public TypeAnnotationPosition call9(Object... param) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, NoSuchFieldException {
return (TypeAnnotationPosition) TypeAnnotationPosition.class
.getMethod("typeParameter", List.class, JCLambda.class, int.class, int.class)
.invoke(null, TypeAnnotationPosition.class.getField("emptyPath").get(null), null, tpidx, pos);
}
}
);
}
示例8: methodTypeParameterTAPosition
import com.sun.tools.javac.code.TargetType; //导入依赖的package包/类
public static TypeAnnotationPosition methodTypeParameterTAPosition(SourceVersion ver, final int tpidx, final int pos) {
return call8or9(ver,
new TAPCall() {
@Override
public TypeAnnotationPosition call8(Object ... p) throws InstantiationException, IllegalAccessException, IllegalArgumentException, NoSuchFieldException, SecurityException {
TypeAnnotationPosition tapos = TypeAnnotationPosition.class.newInstance();
TypeAnnotationPosition.class.getField("type").set(tapos, TargetType.METHOD_TYPE_PARAMETER);
TypeAnnotationPosition.class.getField("parameter_index").set(tapos, tpidx);
TypeAnnotationPosition.class.getField("pos").set(tapos, pos);
return tapos;
}
@Override
public TypeAnnotationPosition call9(Object... param) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, NoSuchFieldException {
return (TypeAnnotationPosition) TypeAnnotationPosition.class
.getMethod("methodTypeParameter", List.class, JCLambda.class, int.class, int.class)
.invoke(null, TypeAnnotationPosition.class.getField("emptyPath").get(null), null, tpidx, pos);
}
}
);
}
示例9: typeParameterBoundTAPosition
import com.sun.tools.javac.code.TargetType; //导入依赖的package包/类
public static TypeAnnotationPosition typeParameterBoundTAPosition(SourceVersion ver, final int tpidx, final int bndidx, final int pos) {
return call8or9(ver,
new TAPCall() {
@Override
public TypeAnnotationPosition call8(Object ... p) throws InstantiationException, IllegalAccessException, IllegalArgumentException, NoSuchFieldException, SecurityException {
TypeAnnotationPosition tapos = TypeAnnotationPosition.class.newInstance();
TypeAnnotationPosition.class.getField("type").set(tapos, TargetType.CLASS_TYPE_PARAMETER_BOUND);
TypeAnnotationPosition.class.getField("parameter_index").set(tapos, tpidx);
TypeAnnotationPosition.class.getField("bound_index").set(tapos, bndidx);
TypeAnnotationPosition.class.getField("pos").set(tapos, pos);
return tapos;
}
@Override
public TypeAnnotationPosition call9(Object... param) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, NoSuchFieldException {
return (TypeAnnotationPosition) TypeAnnotationPosition.class
.getMethod("typeParameterBound", List.class, JCLambda.class, int.class, int.class, int.class)
.invoke(null, TypeAnnotationPosition.class.getField("emptyPath").get(null), null, tpidx, bndidx, pos);
}
}
);
}
示例10: methodTypeParameterBoundTAPosition
import com.sun.tools.javac.code.TargetType; //导入依赖的package包/类
public static TypeAnnotationPosition methodTypeParameterBoundTAPosition(SourceVersion ver, final int tpidx, final int bndidx, final int pos) {
return call8or9(ver,
new TAPCall() {
@Override
public TypeAnnotationPosition call8(Object ... p) throws InstantiationException, IllegalAccessException, IllegalArgumentException, NoSuchFieldException, SecurityException {
TypeAnnotationPosition tapos = TypeAnnotationPosition.class.newInstance();
TypeAnnotationPosition.class.getField("type").set(tapos, TargetType.METHOD_TYPE_PARAMETER_BOUND);
TypeAnnotationPosition.class.getField("parameter_index").set(tapos, tpidx);
TypeAnnotationPosition.class.getField("bound_index").set(tapos, bndidx);
TypeAnnotationPosition.class.getField("pos").set(tapos, pos);
return tapos;
}
@Override
public TypeAnnotationPosition call9(Object... param) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, NoSuchFieldException {
return (TypeAnnotationPosition) TypeAnnotationPosition.class
.getMethod("methodTypeParameterBound", List.class, JCLambda.class, int.class, int.class, int.class)
.invoke(null, TypeAnnotationPosition.class.getField("emptyPath").get(null), null, tpidx, bndidx, pos);
}
}
);
}
示例11: methodParameterTAPosition
import com.sun.tools.javac.code.TargetType; //导入依赖的package包/类
public static TypeAnnotationPosition methodParameterTAPosition(final int pidx, final int pos) {
TypeAnnotationPosition tapos = new TypeAnnotationPosition();
tapos.type = TargetType.METHOD_FORMAL_PARAMETER;
tapos.parameter_index = pidx;
tapos.pos = pos;
return tapos;
}
示例12: methodThrowsTAPosition
import com.sun.tools.javac.code.TargetType; //导入依赖的package包/类
public static TypeAnnotationPosition methodThrowsTAPosition(final int tidx, final int pos) {
TypeAnnotationPosition tapos = new TypeAnnotationPosition();
tapos.type = TargetType.THROWS;
tapos.type_index = tidx;
tapos.pos = pos;
return tapos;
}
示例13: classExtendsTAPosition
import com.sun.tools.javac.code.TargetType; //导入依赖的package包/类
public static TypeAnnotationPosition classExtendsTAPosition(final int implidx, final int pos) {
TypeAnnotationPosition tapos = new TypeAnnotationPosition();
tapos.type = TargetType.CLASS_EXTENDS;
tapos.type_index = implidx;
tapos.pos = pos;
return tapos;
}
示例14: typeParameterTAPosition
import com.sun.tools.javac.code.TargetType; //导入依赖的package包/类
public static TypeAnnotationPosition typeParameterTAPosition(final int tpidx, final int pos) {
TypeAnnotationPosition tapos = new TypeAnnotationPosition();
tapos.type = TargetType.CLASS_TYPE_PARAMETER;
tapos.parameter_index = tpidx;
tapos.pos = pos;
return tapos;
}
示例15: methodTypeParameterTAPosition
import com.sun.tools.javac.code.TargetType; //导入依赖的package包/类
public static TypeAnnotationPosition methodTypeParameterTAPosition(
final int tpidx, final int pos) {
TypeAnnotationPosition tapos = new TypeAnnotationPosition();
tapos.type = TargetType.METHOD_TYPE_PARAMETER;
tapos.parameter_index = tpidx;
tapos.pos = pos;
return tapos;
}