< prev index next >

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

Print this page
*** 25,10 ***
--- 25,11 ---
  package java.lang.reflect;
  
  import java.lang.annotation.*;
  import java.util.HashMap;
  import java.util.Map;
+ import java.util.Set;
  import java.util.Objects;
  import sun.reflect.annotation.AnnotationSupport;
  
  /**
   * Information about method parameters.

*** 159,10 ***
--- 160,24 ---
       */
      public int getModifiers() {
          return modifiers;
      }
  
+     /**
+      * {@return an unmodifiable set of the {@linkplain AccessFlag
+      * access flags} for the parameter represented by this object,
+      * possibly empty}
+      *
+      * @see #getModifiers()
+      * @jvms 4.7.24 The MethodParameters Attribute
+      * @since 20
+      */
+     public Set<AccessFlag> accessFlags() {
+         return AccessFlag.maskToAccessFlags(getModifiers(),
+                                             AccessFlag.Location.METHOD_PARAMETER);
+     }
+ 
      /**
       * Returns the name of the parameter.  If the parameter's name is
       * {@linkplain #isNamePresent() present}, then this method returns
       * the name provided by the class file. Otherwise, this method
       * synthesizes a name of the form argN, where N is the index of
< prev index next >