本文整理汇总了Java中sun.reflect.annotation.TypeAnnotationParser.buildAnnotatedType方法的典型用法代码示例。如果您正苦于以下问题:Java TypeAnnotationParser.buildAnnotatedType方法的具体用法?Java TypeAnnotationParser.buildAnnotatedType怎么用?Java TypeAnnotationParser.buildAnnotatedType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.reflect.annotation.TypeAnnotationParser
的用法示例。
在下文中一共展示了TypeAnnotationParser.buildAnnotatedType方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getAnnotatedReceiverType
import sun.reflect.annotation.TypeAnnotationParser; //导入方法依赖的package包/类
/**
* Returns an {@code AnnotatedType} object that represents the use of a
* type to specify the receiver type of the method/constructor represented
* by this Executable object. The receiver type of a method/constructor is
* available only if the method/constructor has a <em>receiver
* parameter</em> (JLS 8.4.1).
*
* If this {@code Executable} object represents a constructor or instance
* method that does not have a receiver parameter, or has a receiver
* parameter with no annotations on its type, then the return value is an
* {@code AnnotatedType} object representing an element with no
* annotations.
*
* If this {@code Executable} object represents a static method, then the
* return value is null.
*
* @return an object representing the receiver type of the method or
* constructor represented by this {@code Executable}
*
* @since 1.8
*/
public AnnotatedType getAnnotatedReceiverType() {
if (Modifier.isStatic(this.getModifiers()))
return null;
return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
sun.misc.SharedSecrets.getJavaLangAccess().
getConstantPool(getDeclaringClass()),
this,
getDeclaringClass(),
getDeclaringClass(),
TypeAnnotation.TypeAnnotationTarget.METHOD_RECEIVER);
}
示例8: getAnnotatedReceiverType
import sun.reflect.annotation.TypeAnnotationParser; //导入方法依赖的package包/类
/**
* Returns an {@code AnnotatedType} object that represents the use of a
* type to specify the receiver type of the method/constructor represented
* by this Executable object. The receiver type of a method/constructor is
* available only if the method/constructor has a <em>receiver
* parameter</em> (JLS 8.4.1).
*
* If this {@code Executable} object represents a constructor or instance
* method that does not have a receiver parameter, or has a receiver
* parameter with no annotations on its type, then the return value is an
* {@code AnnotatedType} object representing an element with no
* annotations.
*
* If this {@code Executable} object represents a static method, then the
* return value is null.
*
* @return an object representing the receiver type of the method or
* constructor represented by this {@code Executable}
*/
public AnnotatedType getAnnotatedReceiverType() {
if (Modifier.isStatic(this.getModifiers()))
return null;
return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
sun.misc.SharedSecrets.getJavaLangAccess().
getConstantPool(getDeclaringClass()),
this,
getDeclaringClass(),
getDeclaringClass(),
TypeAnnotation.TypeAnnotationTarget.METHOD_RECEIVER);
}
示例9: getAnnotatedReceiverType
import sun.reflect.annotation.TypeAnnotationParser; //导入方法依赖的package包/类
/**
* Returns an {@code AnnotatedType} object that represents the use of a
* type to specify the receiver type of the method/constructor represented
* by this {@code Executable} object.
*
* The receiver type of a method/constructor is available only if the
* method/constructor has a receiver parameter (JLS 8.4.1). If this {@code
* Executable} object <em>represents an instance method or represents a
* constructor of an inner member class</em>, and the
* method/constructor <em>either</em> has no receiver parameter or has a
* receiver parameter with no annotations on its type, then the return
* value is an {@code AnnotatedType} object representing an element with no
* annotations.
*
* If this {@code Executable} object represents a static method or
* represents a constructor of a top level, static member, local, or
* anonymous class, then the return value is null.
*
* @return an object representing the receiver type of the method or
* constructor represented by this {@code Executable} or {@code null} if
* this {@code Executable} can not have a receiver parameter
*/
public AnnotatedType getAnnotatedReceiverType() {
if (Modifier.isStatic(this.getModifiers()))
return null;
return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
SharedSecrets.getJavaLangAccess().
getConstantPool(getDeclaringClass()),
this,
getDeclaringClass(),
getDeclaringClass(),
TypeAnnotation.TypeAnnotationTarget.METHOD_RECEIVER);
}