Java Code Examples for sun.reflect.annotation.TypeAnnotation

The following examples show how to use sun.reflect.annotation.TypeAnnotation. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: jdk1.8-source-analysis   Source File: Constructor.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * {@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);
}
 
Example 2
Source Project: jdk1.8-source-analysis   Source File: Executable.java    License: Apache License 2.0 5 votes vote down vote up
AnnotatedType getAnnotatedReturnType0(Type returnType) {
    return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
            sun.misc.SharedSecrets.getJavaLangAccess().
                    getConstantPool(getDeclaringClass()),
            this,
            getDeclaringClass(),
            returnType,
            TypeAnnotation.TypeAnnotationTarget.METHOD_RETURN);
}
 
Example 3
Source Project: jdk1.8-source-analysis   Source File: Field.java    License: Apache License 2.0 5 votes vote down vote up
/**
     * 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);
}
 
Example 4
Source Project: dragonwell8_jdk   Source File: Constructor.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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);
}
 
Example 5
Source Project: dragonwell8_jdk   Source File: Executable.java    License: GNU General Public License v2.0 5 votes vote down vote up
AnnotatedType getAnnotatedReturnType0(Type returnType) {
    return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
            sun.misc.SharedSecrets.getJavaLangAccess().
                    getConstantPool(getDeclaringClass()),
            this,
            getDeclaringClass(),
            returnType,
            TypeAnnotation.TypeAnnotationTarget.METHOD_RETURN);
}
 
Example 6
Source Project: dragonwell8_jdk   Source File: Field.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
     * 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);
}
 
Example 7
Source Project: TencentKona-8   Source File: Constructor.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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);
}
 
Example 8
Source Project: TencentKona-8   Source File: Executable.java    License: GNU General Public License v2.0 5 votes vote down vote up
AnnotatedType getAnnotatedReturnType0(Type returnType) {
    return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
            sun.misc.SharedSecrets.getJavaLangAccess().
                    getConstantPool(getDeclaringClass()),
            this,
            getDeclaringClass(),
            returnType,
            TypeAnnotation.TypeAnnotationTarget.METHOD_RETURN);
}
 
Example 9
Source Project: TencentKona-8   Source File: Field.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
     * 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);
}
 
Example 10
Source Project: jdk8u60   Source File: Constructor.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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);
}
 
Example 11
Source Project: jdk8u60   Source File: Executable.java    License: GNU General Public License v2.0 5 votes vote down vote up
AnnotatedType getAnnotatedReturnType0(Type returnType) {
    return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
            sun.misc.SharedSecrets.getJavaLangAccess().
                    getConstantPool(getDeclaringClass()),
            this,
            getDeclaringClass(),
            returnType,
            TypeAnnotation.TypeAnnotationTarget.METHOD_RETURN);
}
 
Example 12
Source Project: jdk8u60   Source File: Field.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
     * 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);
}
 
Example 13
Source Project: JDKSourceCode1.8   Source File: Constructor.java    License: MIT License 5 votes vote down vote up
/**
 * {@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);
}
 
Example 14
Source Project: jdk8u_jdk   Source File: Executable.java    License: GNU General Public License v2.0 5 votes vote down vote up
AnnotatedType getAnnotatedReturnType0(Type returnType) {
    return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
            sun.misc.SharedSecrets.getJavaLangAccess().
                    getConstantPool(getDeclaringClass()),
            this,
            getDeclaringClass(),
            returnType,
            TypeAnnotation.TypeAnnotationTarget.METHOD_RETURN);
}
 
Example 15
Source Project: JDKSourceCode1.8   Source File: Field.java    License: MIT License 5 votes vote down vote up
/**
     * 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);
}
 
Example 16
Source Project: openjdk-jdk8u   Source File: Constructor.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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);
}
 
Example 17
Source Project: openjdk-jdk8u   Source File: Executable.java    License: GNU General Public License v2.0 5 votes vote down vote up
AnnotatedType getAnnotatedReturnType0(Type returnType) {
    return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
            sun.misc.SharedSecrets.getJavaLangAccess().
                    getConstantPool(getDeclaringClass()),
            this,
            getDeclaringClass(),
            returnType,
            TypeAnnotation.TypeAnnotationTarget.METHOD_RETURN);
}
 
Example 18
Source Project: openjdk-jdk8u   Source File: Field.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
     * 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);
}
 
Example 19
/**
 * {@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);
}
 
Example 20
AnnotatedType getAnnotatedReturnType0(Type returnType) {
    return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
            sun.misc.SharedSecrets.getJavaLangAccess().
                    getConstantPool(getDeclaringClass()),
            this,
            getDeclaringClass(),
            returnType,
            TypeAnnotation.TypeAnnotationTarget.METHOD_RETURN);
}
 
Example 21
Source Project: openjdk-8   Source File: Executable.java    License: GNU General Public License v2.0 5 votes vote down vote up
AnnotatedType getAnnotatedReturnType0(Type returnType) {
    return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
            sun.misc.SharedSecrets.getJavaLangAccess().
                    getConstantPool(getDeclaringClass()),
            this,
            getDeclaringClass(),
            returnType,
            TypeAnnotation.TypeAnnotationTarget.METHOD_RETURN);
}
 
Example 22
Source Project: Bytecoder   Source File: Constructor.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * {@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);
}
 
Example 23
Source Project: jdk8u_jdk   Source File: Field.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
     * 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);
}
 
Example 24
Source Project: jdk8u_jdk   Source File: Constructor.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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);
}
 
Example 25
Source Project: Bytecoder   Source File: Field.java    License: Apache License 2.0 5 votes vote down vote up
/**
     * 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);
}
 
Example 26
Source Project: Bytecoder   Source File: RecordComponent.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Returns an {@code AnnotatedType} object that represents the use of a type to specify
 * the declared type of this record component.
 *
 * @return an object representing the declared type of this record component
 */
public AnnotatedType getAnnotatedType() {
    return TypeAnnotationParser.buildAnnotatedType(typeAnnotations,
            SharedSecrets.getJavaLangAccess().
                    getConstantPool(getDeclaringRecord()),
            this,
            getDeclaringRecord(),
            getGenericType(),
            TypeAnnotation.TypeAnnotationTarget.FIELD);
}
 
Example 27
Source Project: openjdk-jdk9   Source File: Constructor.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@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);
}
 
Example 28
Source Project: openjdk-jdk9   Source File: Executable.java    License: GNU General Public License v2.0 5 votes vote down vote up
AnnotatedType getAnnotatedReturnType0(Type returnType) {
    return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
            SharedSecrets.getJavaLangAccess().
                    getConstantPool(getDeclaringClass()),
            this,
            getDeclaringClass(),
            returnType,
            TypeAnnotation.TypeAnnotationTarget.METHOD_RETURN);
}
 
Example 29
Source Project: openjdk-8   Source File: Field.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
     * 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);
}
 
Example 30
Source Project: openjdk-jdk9   Source File: Field.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
     * 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);
}