Enum JModifier

    • Enum Constant Detail

      • PUBLIC

        public static final JModifier PUBLIC
      • PROTECTED

        public static final JModifier PROTECTED
      • PRIVATE

        public static final JModifier PRIVATE
      • SEALED

        public static final JModifier SEALED
        Modifier "sealed" (preview feature of JDK 15).
      • NON_SEALED

        public static final JModifier NON_SEALED
        Modifier "non-sealed" (preview feature of JDK 15).
      • ABSTRACT

        public static final JModifier ABSTRACT
      • STATIC

        public static final JModifier STATIC
      • SYNCHRONIZED

        public static final JModifier SYNCHRONIZED
      • NATIVE

        public static final JModifier NATIVE
      • DEFAULT

        public static final JModifier DEFAULT
      • STRICTFP

        public static final JModifier STRICTFP
      • TRANSIENT

        public static final JModifier TRANSIENT
      • VOLATILE

        public static final JModifier VOLATILE
    • Method Detail

      • values

        public static JModifier[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (JModifier c : JModifier.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static JModifier valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getReflectMod

        public int getReflectMod()
        Returns the constant of java.lang.reflect.Modifier that this modifier corresponds to. Be aware that the following constants are source-level modifiers only, for which this method returns 0:
        • DEFAULT: this doesn't exist at the class file level. A default method is a non-static non-abstract public method declared in an interface (JExecutableSymbol.isDefaultMethod().
        • SEALED: a sealed class has an attribute PermittedSubclasses with a non-zero length (in the compiled class file)
        • NON_SEALED: this doesn't exist at the class file level at all. But a class must have the non-sealed modifier in source if it is neither sealed, nor final, and appears in the PermittedSubclasses attribute of some direct supertype.
      • getToken

        public String getToken()
        Returns how the modifier is written in source.