< prev index next >

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

Print this page




 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     static final int FLATTENED  = 0x00008000;
 456 
 457     /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
 458     public boolean isBridge() {
 459         return testAllFlags(IS_METHOD | BRIDGE);
 460     }
 461     /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
 462     public boolean isVarargs() {
 463         return testAllFlags(VARARGS) && isInvocable();
 464     }
 465     /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
 466     public boolean isSynthetic() {
 467         return testAllFlags(SYNTHETIC);
 468     }
 469 
 470     public boolean isValue() { return clazz.isValue(); }
 471 
 472     public boolean isFlattened() { return (flags & FLATTENED) == FLATTENED; }
 473 




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




 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     static final int FLATTENABLE = 0x00000100;
 456     static final int FLATTENED   = 0x00008000;
 457 
 458     /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
 459     public boolean isBridge() {
 460         return testAllFlags(IS_METHOD | BRIDGE);
 461     }
 462     /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
 463     public boolean isVarargs() {
 464         return testAllFlags(VARARGS) && isInvocable();
 465     }
 466     /** Utility method to query the modifier flags of this member; returns false if the member is not a method. */
 467     public boolean isSynthetic() {
 468         return testAllFlags(SYNTHETIC);
 469     }
 470 
 471     public boolean isFlattenable() { return (flags & FLATTENABLE) == FLATTENABLE; }
 472 
 473     public boolean isFlattened() { return (flags & FLATTENED) == FLATTENED; }
 474 
 475     public boolean isNullable()  { return !isFlattenable(); }
 476 
 477     public boolean isValue() { return clazz.isValue(); }
 478 
 479     static final String CONSTRUCTOR_NAME = "<init>";  // the ever-popular
 480 
 481     // modifiers exported by the JVM:
 482     static final int RECOGNIZED_MODIFIERS = 0xFFFF;
 483 
 484     // private flags, not part of RECOGNIZED_MODIFIERS:
 485     static final int
 486             IS_METHOD        = MN_IS_METHOD,        // method (not constructor)
 487             IS_CONSTRUCTOR   = MN_IS_CONSTRUCTOR,   // constructor
 488             IS_FIELD         = MN_IS_FIELD,         // field
 489             IS_TYPE          = MN_IS_TYPE,          // nested type
 490             CALLER_SENSITIVE = MN_CALLER_SENSITIVE; // @CallerSensitive annotation detected
 491 
 492     static final int ALL_ACCESS = Modifier.PUBLIC | Modifier.PRIVATE | Modifier.PROTECTED;
 493     static final int ALL_KINDS = IS_METHOD | IS_CONSTRUCTOR | IS_FIELD | IS_TYPE;
 494     static final int IS_INVOCABLE = IS_METHOD | IS_CONSTRUCTOR;
 495     static final int IS_FIELD_OR_METHOD = IS_METHOD | IS_FIELD;
 496     static final int SEARCH_ALL_SUPERS = MN_SEARCH_SUPERCLASSES | MN_SEARCH_INTERFACES;
 497 
 498     /** Utility method to query whether this member is a method or constructor. */


< prev index next >