本文整理匯總了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;
}