本文整理汇总了Java中sun.reflect.annotation.TypeAnnotationParser类的典型用法代码示例。如果您正苦于以下问题:Java TypeAnnotationParser类的具体用法?Java TypeAnnotationParser怎么用?Java TypeAnnotationParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypeAnnotationParser类属于sun.reflect.annotation包,在下文中一共展示了TypeAnnotationParser类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAnnotatedReceiverType
import sun.reflect.annotation.TypeAnnotationParser; //导入依赖的package包/类
/**
* {@inheritDoc}
* @since 1.8
*/
@Override
public AnnotatedType getAnnotatedReceiverType() {
if (getDeclaringClass().getEnclosingClass() == null)
return super.getAnnotatedReceiverType();
return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
sun.misc.SharedSecrets.getJavaLangAccess().
getConstantPool(getDeclaringClass()),
this,
getDeclaringClass(),
getDeclaringClass().getEnclosingClass(),
TypeAnnotation.TypeAnnotationTarget.METHOD_RECEIVER);
}
示例2: getAnnotatedReturnType0
import sun.reflect.annotation.TypeAnnotationParser; //导入依赖的package包/类
AnnotatedType getAnnotatedReturnType0(Type returnType) {
return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
sun.misc.SharedSecrets.getJavaLangAccess().
getConstantPool(getDeclaringClass()),
this,
getDeclaringClass(),
returnType,
TypeAnnotation.TypeAnnotationTarget.METHOD_RETURN);
}
示例3: getAnnotatedType
import sun.reflect.annotation.TypeAnnotationParser; //导入依赖的package包/类
/**
* Returns an AnnotatedType object that represents the use of a type to specify
* the declared type of the field represented by this Field.
* @return an object representing the declared type of the field
* represented by this Field
*
* @since 1.8
*/
public AnnotatedType getAnnotatedType() {
return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
sun.misc.SharedSecrets.getJavaLangAccess().
getConstantPool(getDeclaringClass()),
this,
getDeclaringClass(),
getGenericType(),
TypeAnnotation.TypeAnnotationTarget.FIELD);
}
示例4: getAnnotatedReceiverType
import sun.reflect.annotation.TypeAnnotationParser; //导入依赖的package包/类
/**
* {@inheritDoc}
* @since 1.8
*/
@Override
public AnnotatedType getAnnotatedReceiverType() {
Class<?> thisDeclClass = getDeclaringClass();
Class<?> enclosingClass = thisDeclClass.getEnclosingClass();
if (enclosingClass == null) {
// A Constructor for a top-level class
return null;
}
Class<?> outerDeclaringClass = thisDeclClass.getDeclaringClass();
if (outerDeclaringClass == null) {
// A constructor for a local or anonymous class
return null;
}
// Either static nested or inner class
if (Modifier.isStatic(thisDeclClass.getModifiers())) {
// static nested
return null;
}
// A Constructor for an inner class
return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
SharedSecrets.getJavaLangAccess().
getConstantPool(thisDeclClass),
this,
thisDeclClass,
enclosingClass,
TypeAnnotation.TypeAnnotationTarget.METHOD_RECEIVER);
}
示例5: getAnnotatedReturnType0
import sun.reflect.annotation.TypeAnnotationParser; //导入依赖的package包/类
AnnotatedType getAnnotatedReturnType0(Type returnType) {
return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
SharedSecrets.getJavaLangAccess().
getConstantPool(getDeclaringClass()),
this,
getDeclaringClass(),
returnType,
TypeAnnotation.TypeAnnotationTarget.METHOD_RETURN);
}
示例6: getAnnotatedType
import sun.reflect.annotation.TypeAnnotationParser; //导入依赖的package包/类
/**
* Returns an AnnotatedType object that represents the use of a type to specify
* the declared type of the field represented by this Field.
* @return an object representing the declared type of the field
* represented by this Field
*
* @since 1.8
*/
public AnnotatedType getAnnotatedType() {
return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
SharedSecrets.getJavaLangAccess().
getConstantPool(getDeclaringClass()),
this,
getDeclaringClass(),
getGenericType(),
TypeAnnotation.TypeAnnotationTarget.FIELD);
}
示例7: getAnnotations
import sun.reflect.annotation.TypeAnnotationParser; //导入依赖的package包/类
public Annotation[] getAnnotations() {
int myIndex = typeVarIndex();
if (myIndex < 0)
throw new AssertionError("Index must be non-negative.");
return TypeAnnotationParser.parseTypeVariableAnnotations(getGenericDeclaration(), myIndex);
}
示例8: getAnnotatedBounds
import sun.reflect.annotation.TypeAnnotationParser; //导入依赖的package包/类
public AnnotatedType[] getAnnotatedBounds() {
return TypeAnnotationParser.parseAnnotatedBounds(getBounds(),
getGenericDeclaration(),
typeVarIndex());
}