< prev index next >

src/java.base/share/classes/java/lang/invoke/MemberName.java

Print this page




 433         return Modifier.isFinal(flags | clazz.getModifiers());
 434     }
 435     /** Utility method to query the modifier flags of this member. */
 436     public boolean isVolatile() {
 437         return Modifier.isVolatile(flags);
 438     }
 439     /** Utility method to query the modifier flags of this member. */
 440     public boolean isAbstract() {
 441         return Modifier.isAbstract(flags);
 442     }
 443     /** Utility method to query the modifier flags of this member. */
 444     public boolean isNative() {
 445         return Modifier.isNative(flags);
 446     }
 447     // let the rest (native, volatile, transient, etc.) be tested via Modifier.isFoo
 448 
 449     // unofficial modifier flags, used by HotSpot:
 450     static final int BRIDGE    = 0x00000040;
 451     static final int VARARGS   = 0x00000080;
 452     static final int SYNTHETIC = 0x00001000;
 453     static final int ANNOTATION= 0x00002000;
 454     static final int ENUM      = 0x00004000;

 455     /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
 456     public boolean isBridge() {
 457         return testAllFlags(IS_METHOD | BRIDGE);
 458     }
 459     /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
 460     public boolean isVarargs() {
 461         return testAllFlags(VARARGS) && isInvocable();
 462     }
 463     /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
 464     public boolean isSynthetic() {
 465         return testAllFlags(SYNTHETIC);
 466     }
 467 



 468     static final String CONSTRUCTOR_NAME = "<init>";  // the ever-popular
 469 
 470     // modifiers exported by the JVM:
 471     static final int RECOGNIZED_MODIFIERS = 0xFFFF;
 472 
 473     // private flags, not part of RECOGNIZED_MODIFIERS:
 474     static final int
 475             IS_METHOD        = MN_IS_METHOD,        // method (not constructor)
 476             IS_CONSTRUCTOR   = MN_IS_CONSTRUCTOR,   // constructor
 477             IS_FIELD         = MN_IS_FIELD,         // field
 478             IS_TYPE          = MN_IS_TYPE,          // nested type
 479             CALLER_SENSITIVE = MN_CALLER_SENSITIVE; // @CallerSensitive annotation detected
 480 
 481     static final int ALL_ACCESS = Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED;
 482     static final int ALL_KINDS = IS_METHOD | IS_CONSTRUCTOR | IS_FIELD | IS_TYPE;
 483     static final int IS_INVOCABLE = IS_METHOD | IS_CONSTRUCTOR;
 484     static final int IS_FIELD_OR_METHOD = IS_METHOD | IS_FIELD;
 485     static final int SEARCH_ALL_SUPERS = MN_SEARCH_SUPERCLASSES | MN_SEARCH_INTERFACES;
 486 
 487     /** Utility method to query whether this member is a method or constructor. */




 433         return Modifier.isFinal(flags | clazz.getModifiers());
 434     }
 435     /** Utility method to query the modifier flags of this member. */
 436     public boolean isVolatile() {
 437         return Modifier.isVolatile(flags);
 438     }
 439     /** Utility method to query the modifier flags of this member. */
 440     public boolean isAbstract() {
 441         return Modifier.isAbstract(flags);
 442     }
 443     /** Utility method to query the modifier flags of this member. */
 444     public boolean isNative() {
 445         return Modifier.isNative(flags);
 446     }
 447     // let the rest (native, volatile, transient, etc.) be tested via Modifier.isFoo
 448 
 449     // unofficial modifier flags, used by HotSpot:
 450     static final int BRIDGE     = 0x00000040;
 451     static final int VARARGS    = 0x00000080;
 452     static final int SYNTHETIC  = 0x00001000;
 453     static final int ANNOTATION = 0x00002000;
 454     static final int ENUM       = 0x00004000;
 455 
 456     /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
 457     public boolean isBridge() {
 458         return testAllFlags(IS_METHOD | BRIDGE);
 459     }
 460     /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
 461     public boolean isVarargs() {
 462         return testAllFlags(VARARGS) && isInvocable();
 463     }
 464     /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
 465     public boolean isSynthetic() {
 466         return testAllFlags(SYNTHETIC);
 467     }
 468 
 469     public boolean isValue() { return clazz.isValue(); }
 470 
 471 
 472     static final String CONSTRUCTOR_NAME = "<init>";  // the ever-popular
 473 
 474     // modifiers exported by the JVM:
 475     static final int RECOGNIZED_MODIFIERS = 0xFFFF;
 476 
 477     // private flags, not part of RECOGNIZED_MODIFIERS:
 478     static final int
 479             IS_METHOD        = MN_IS_METHOD,        // method (not constructor)
 480             IS_CONSTRUCTOR   = MN_IS_CONSTRUCTOR,   // constructor
 481             IS_FIELD         = MN_IS_FIELD,         // field
 482             IS_TYPE          = MN_IS_TYPE,          // nested type
 483             CALLER_SENSITIVE = MN_CALLER_SENSITIVE; // @CallerSensitive annotation detected
 484 
 485     static final int ALL_ACCESS = Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED;
 486     static final int ALL_KINDS = IS_METHOD | IS_CONSTRUCTOR | IS_FIELD | IS_TYPE;
 487     static final int IS_INVOCABLE = IS_METHOD | IS_CONSTRUCTOR;
 488     static final int IS_FIELD_OR_METHOD = IS_METHOD | IS_FIELD;
 489     static final int SEARCH_ALL_SUPERS = MN_SEARCH_SUPERCLASSES | MN_SEARCH_INTERFACES;
 490 
 491     /** Utility method to query whether this member is a method or constructor. */


< prev index next >