本文整理汇总了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);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:Constructor.java
示例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);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:Executable.java
示例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);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:Field.java
示例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);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:36,代码来源:Constructor.java
示例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);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:Executable.java
示例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);
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:Field.java
示例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);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:TypeVariableImpl.java
示例8: getAnnotatedBounds
import sun.reflect.annotation.TypeAnnotationParser; //导入依赖的package包/类
public AnnotatedType[] getAnnotatedBounds() {
return TypeAnnotationParser.parseAnnotatedBounds(getBounds(),
getGenericDeclaration(),
typeVarIndex());
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:TypeVariableImpl.java
注:本文中的sun.reflect.annotation.TypeAnnotationParser类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论