< prev index next >

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

Print this page

197      * that declares the executable represented by this object.
198      */
199     public abstract Class<?> getDeclaringClass();
200 
201     /**
202      * Returns the name of the executable represented by this object.
203      */
204     public abstract String getName();
205 
206     /**
207      * {@return the Java language {@linkplain Modifier modifiers} for
208      * the executable represented by this object}
209      * @see #accessFlags
210      */
211     public abstract int getModifiers();
212 
213     /**
214      * {@return an unmodifiable set of the {@linkplain AccessFlag
215      * access flags} for the executable represented by this object,
216      * possibly empty}

217      *
218      * @see #getModifiers()
219      * @jvms 4.6 Methods
220      * @since 20
221      */
222     @Override
223     public Set<AccessFlag> accessFlags() {
224         return reflectionFactory.parseAccessFlags(getModifiers(),
225                                                   AccessFlag.Location.METHOD,
226                                                   getDeclaringClass());
227     }
228 
229     /**
230      * Returns an array of {@code TypeVariable} objects that represent the
231      * type variables declared by the generic declaration represented by this
232      * {@code GenericDeclaration} object, in declaration order.  Returns an
233      * array of length 0 if the underlying generic declaration declares no type
234      * variables.
235      *
236      * @return an array of {@code TypeVariable} objects that represent

197      * that declares the executable represented by this object.
198      */
199     public abstract Class<?> getDeclaringClass();
200 
201     /**
202      * Returns the name of the executable represented by this object.
203      */
204     public abstract String getName();
205 
206     /**
207      * {@return the Java language {@linkplain Modifier modifiers} for
208      * the executable represented by this object}
209      * @see #accessFlags
210      */
211     public abstract int getModifiers();
212 
213     /**
214      * {@return an unmodifiable set of the {@linkplain AccessFlag
215      * access flags} for the executable represented by this object,
216      * possibly empty}
217      * The {@code AccessFlags} may depend on the class file format version of the class.
218      *
219      * @see #getModifiers()
220      * @jvms 4.6 Methods
221      * @since 20
222      */
223     @Override
224     public Set<AccessFlag> accessFlags() {
225         return reflectionFactory.parseAccessFlags(getModifiers(),
226                                                   AccessFlag.Location.METHOD,
227                                                   getDeclaringClass());
228     }
229 
230     /**
231      * Returns an array of {@code TypeVariable} objects that represent the
232      * type variables declared by the generic declaration represented by this
233      * {@code GenericDeclaration} object, in declaration order.  Returns an
234      * array of length 0 if the underlying generic declaration declares no type
235      * variables.
236      *
237      * @return an array of {@code TypeVariable} objects that represent
< prev index next >