Java Code Examples for sun.reflect.annotation.AnnotationParser#parseParameterAnnotations()

The following examples show how to use sun.reflect.annotation.AnnotationParser#parseParameterAnnotations() . 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 File: Executable.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           sun.misc.SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 2
Source File: Executable.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           sun.misc.SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 3
Source File: Constructor.java    From jdk-1.7-annotated with Apache License 2.0 5 votes vote down vote up
/**
 * Returns an array of arrays that represent the annotations on the formal
 * parameters, in declaration order, of the method represented by
 * this {@code Constructor} object. (Returns an array of length zero if the
 * underlying method is parameterless.  If the method has one or more
 * parameters, a nested array of length zero is returned for each parameter
 * with no annotations.) The annotation objects contained in the returned
 * arrays are serializable.  The caller of this method is free to modify
 * the returned arrays; it will have no effect on the arrays returned to
 * other callers.
 *
 * @return an array of arrays that represent the annotations on the formal
 *    parameters, in declaration order, of the method represented by this
 *    Constructor object
 * @since 1.5
 */
public Annotation[][] getParameterAnnotations() {
    int numParameters = parameterTypes.length;
    if (parameterAnnotations == null)
        return new Annotation[numParameters][0];

    Annotation[][] result = AnnotationParser.parseParameterAnnotations(
        parameterAnnotations,
        sun.misc.SharedSecrets.getJavaLangAccess().
            getConstantPool(getDeclaringClass()),
        getDeclaringClass());
    if (result.length != numParameters) {
        Class<?> declaringClass = getDeclaringClass();
        if (declaringClass.isEnum() ||
            declaringClass.isAnonymousClass() ||
            declaringClass.isLocalClass() )
            ; // Can't do reliable parameter counting
        else {
            if (!declaringClass.isMemberClass() || // top-level
                // Check for the enclosing instance parameter for
                // non-static member classes
                (declaringClass.isMemberClass() &&
                 ((declaringClass.getModifiers() & Modifier.STATIC) == 0)  &&
                 result.length + 1 != numParameters) ) {
                throw new AnnotationFormatError(
                          "Parameter annotations don't match number of parameters");
            }
        }
    }
    return result;
}
 
Example 4
Source File: Executable.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           sun.misc.SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 5
Source File: Executable.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           sun.misc.SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 6
Source File: Executable.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           sun.misc.SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 7
Source File: Executable.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           sun.misc.SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 8
Source File: Executable.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           sun.misc.SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 9
Source File: Executable.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           sun.misc.SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 10
Source File: Executable.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           sun.misc.SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 11
Source File: Executable.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 12
Source File: Executable.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 13
Source File: Executable.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           sun.misc.SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 14
Source File: Executable.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           sun.misc.SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 15
Source File: Executable.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           sun.misc.SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 16
Source File: Executable.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           sun.misc.SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 17
Source File: Executable.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           sun.misc.SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 18
Source File: Executable.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
Annotation[][] parseParameterAnnotations(byte[] parameterAnnotations) {
    return AnnotationParser.parseParameterAnnotations(
           parameterAnnotations,
           sun.misc.SharedSecrets.getJavaLangAccess().
           getConstantPool(getDeclaringClass()),
           getDeclaringClass());
}
 
Example 19
Source File: Method.java    From jdk-1.7-annotated with Apache License 2.0 4 votes vote down vote up
/**
 * Returns an array of arrays that represent the annotations on the formal
 * parameters, in declaration order, of the method represented by
 * this {@code Method} object. (Returns an array of length zero if the
 * underlying method is parameterless.  If the method has one or more
 * parameters, a nested array of length zero is returned for each parameter
 * with no annotations.) The annotation objects contained in the returned
 * arrays are serializable.  The caller of this method is free to modify
 * the returned arrays; it will have no effect on the arrays returned to
 * other callers.
 *
 * @return an array of arrays that represent the annotations on the formal
 *    parameters, in declaration order, of the method represented by this
 *    Method object
 * @since 1.5
 */
public Annotation[][] getParameterAnnotations() {
    int numParameters = parameterTypes.length;
    if (parameterAnnotations == null)
        return new Annotation[numParameters][0];

    Annotation[][] result = AnnotationParser.parseParameterAnnotations(
        parameterAnnotations,
        sun.misc.SharedSecrets.getJavaLangAccess().
            getConstantPool(getDeclaringClass()),
        getDeclaringClass());
    if (result.length != numParameters)
        throw new java.lang.annotation.AnnotationFormatError(
            "Parameter annotations don't match number of parameters");
    return result;
}