src/share/classes/java/lang/reflect/Parameter.java

Print this page




 173     /**
 174      * Returns a {@code Class} object that identifies the
 175      * declared type for the parameter represented by this
 176      * {@code Parameter} object.
 177      *
 178      * @return a {@code Class} object identifying the declared
 179      * type of the parameter represented by this object
 180      */
 181     public Class<?> getType() {
 182         Class<?> tmp = parameterClassCache;
 183         if (null == tmp) {
 184             tmp = executable.getParameterTypes()[index];
 185             parameterClassCache = tmp;
 186         }
 187         return tmp;
 188     }
 189 
 190     private transient volatile Class<?> parameterClassCache = null;
 191 
 192     /**
 193      * Returns {@code true} if this parameter is a synthesized
 194      * construct; returns {@code false} otherwise.
 195      *
 196      * @return true if and only if this parameter is a synthesized
 197      * construct as defined by
 198      * <cite>The Java&trade; Language Specification</cite>.
 199      */
 200     public boolean isSynthesized() {
 201         return Modifier.isSynthesized(getModifiers());
 202     }
 203 
 204     /**
 205      * Returns {@code true} if this parameter is a synthetic
 206      * construct; returns {@code false} otherwise.
 207      *
 208      * @jls 13.1 The Form of a Binary
 209      * @return true if and only if this parameter is a synthetic
 210      * construct as defined by
 211      * <cite>The Java&trade; Language Specification</cite>.
 212      */
 213     public boolean isSynthetic() {
 214         return Modifier.isSynthetic(getModifiers());
 215     }
 216 
 217     /**
 218      * Returns {@code true} if this parameter represents a variable
 219      * argument list; returns {@code false} otherwise.
 220      *
 221      * @return {@code true} if an only if this parameter represents a




 173     /**
 174      * Returns a {@code Class} object that identifies the
 175      * declared type for the parameter represented by this
 176      * {@code Parameter} object.
 177      *
 178      * @return a {@code Class} object identifying the declared
 179      * type of the parameter represented by this object
 180      */
 181     public Class<?> getType() {
 182         Class<?> tmp = parameterClassCache;
 183         if (null == tmp) {
 184             tmp = executable.getParameterTypes()[index];
 185             parameterClassCache = tmp;
 186         }
 187         return tmp;
 188     }
 189 
 190     private transient volatile Class<?> parameterClassCache = null;
 191 
 192     /**
 193      * Returns {@code true} if this parameter is a mandated
 194      * construct; returns {@code false} otherwise.
 195      *
 196      * @return true if and only if this parameter is a mandated
 197      * construct as defined by
 198      * <cite>The Java&trade; Language Specification</cite>.
 199      */
 200     public boolean isMandated() {
 201         return Modifier.isMandated(getModifiers());
 202     }
 203 
 204     /**
 205      * Returns {@code true} if this parameter is a synthetic
 206      * construct; returns {@code false} otherwise.
 207      *
 208      * @jls 13.1 The Form of a Binary
 209      * @return true if and only if this parameter is a synthetic
 210      * construct as defined by
 211      * <cite>The Java&trade; Language Specification</cite>.
 212      */
 213     public boolean isSynthetic() {
 214         return Modifier.isSynthetic(getModifiers());
 215     }
 216 
 217     /**
 218      * Returns {@code true} if this parameter represents a variable
 219      * argument list; returns {@code false} otherwise.
 220      *
 221      * @return {@code true} if an only if this parameter represents a