Class Modifier


  • public class Modifier
    extends Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ABSTRACT
      The int value representing the abstract modifier.
      static int ANNOTATION  
      static int BRIDGE  
      static int CLASS_MEMBER
      The code indicating something is a class member
      static int DEPRECATED
      The int value representing the enum modifier.
      static int ENUM  
      static int FINAL
      The int value representing the final modifier.
      static int HIDE
      The int value representing the hide modifier.
      static int INTERFACE
      The int value representing the interface modifier.
      static int INTERNAL
      The int value representing the internal modifier.
      static int MANDATED  
      static int NATIVE
      The int value representing the native modifier.
      static int OVERRIDE
      The int value representing the override modifier.
      static int PRIVATE
      The int value representing the private modifier.
      static int PROTECTED
      The int value representing the protected modifier.
      static int PUBLIC
      The int value representing the public modifier.
      static int REIFIED
      The int value representing the reified modifier.
      static int STATIC
      The int value representing the static modifier.
      static int STRICT
      The int value representing the strictfp modifier.
      static int SYNCHRONIZED
      The int value representing the synchronized modifier.
      static int SYNTHETIC  
      static int TRANSIENT
      The int value representing the transient modifier.
      static int VARARGS  
      static int VOLATILE
      The int value representing the volatile modifier.
    • Constructor Summary

      Constructors 
      Constructor Description
      Modifier()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int classModifiers()
      Return an int value OR-ing together the source language modifiers that can be applied to a class.
      static int constructorModifiers()
      Return an int value OR-ing together the source language modifiers that can be applied to a constructor.
      static int fieldModifiers()
      Return an int value OR-ing together the source language modifiers that can be applied to a field.
      static int getModifiersFrom​(IAttributedFeatureInfo afi)  
      static int interfaceModifiers()
      Return an int value OR-ing together the source language modifiers that can be applied to an interface.
      static boolean isAbstract​(int mod)
      Return true if the integer argument includes the abstract modifier, false otherwise.
      static boolean isAnnotation​(int mod)  
      static boolean isClassMember​(int mod)
      Return true if the integer argument includes the class member modifer, false otherwise.
      static boolean isDeprecated​(int mod)  
      static boolean isEnum​(int mod)
      Return true if the integer argument includes the enum modifer, false otherwise.
      static boolean isFinal​(int mod)
      Return true if the integer argument includes the final modifier, false otherwise.
      static boolean isHide​(int mod)
      Return true if the integer argument includes the hide modifer, false otherwise.
      static boolean isInterface​(int mod)
      Return true if the integer argument includes the interface modifier, false otherwise.
      static boolean isInternal​(int mod)
      Return true if the integer argument includes the internal modifer, false otherwise.
      static boolean isMandated​(int mod)  
      static boolean isNative​(int mod)
      Return true if the integer argument includes the native modifier, false otherwise.
      static boolean isOverride​(int mod)
      Return true if the integer argument includes the override modifer, false otherwise.
      static boolean isPrivate​(int mod)
      Return true if the integer argument includes the private modifier, false otherwise.
      static boolean isProtected​(int mod)
      Return true if the integer argument includes the protected modifier, false otherwise.
      static boolean isPublic​(int mod)
      Return true if the integer argument includes the public modifier, false otherwise.
      static boolean isReified​(int mod)  
      static boolean isStatic​(int mod)
      Return true if the integer argument includes the static modifier, false otherwise.
      static boolean isStrict​(int mod)
      Return true if the integer argument includes the strictfp modifier, false otherwise.
      static boolean isSynchronized​(int mod)
      Return true if the integer argument includes the synchronized modifier, false otherwise.
      static boolean isSynthetic​(int mod)  
      static boolean isTransient​(int mod)
      Return true if the integer argument includes the transient modifier, false otherwise.
      static boolean isVolatile​(int mod)
      Return true if the integer argument includes the volatile modifier, false otherwise.
      static int methodModifiers()
      Return an int value OR-ing together the source language modifiers that can be applied to a method.
      static int parameterModifiers()
      Return an int value OR-ing together the source language modifiers that can be applied to a parameter.
      static int setAbstract​(int mod, boolean bValue)  
      static int setClassMember​(int mod, boolean bValue)  
      static int setDeprecated​(int mod, boolean bValue)  
      static int setEnum​(int mod, boolean bValue)  
      static int setFinal​(int mod, boolean bValue)  
      static int setHide​(int mod, boolean bValue)  
      static int setInternal​(int mod, boolean bValue)  
      static int setOverride​(int mod, boolean bValue)  
      static int setPrivate​(int mod, boolean bValue)  
      static int setProtected​(int mod, boolean bValue)  
      static int setPublic​(int mod, boolean bValue)  
      static int setReified​(int mod, boolean bValue)  
      static int setStatic​(int mod, boolean bValue)  
      static int setTransient​(int mod, boolean bValue)  
      static String toModifierString​(int mod)  
      static String toString​(int mod)
      Return a string describing the access modifier flags in the specified modifier.
    • Field Detail

      • PUBLIC

        public static final int PUBLIC
        The int value representing the public modifier.
        See Also:
        Constant Field Values
      • PRIVATE

        public static final int PRIVATE
        The int value representing the private modifier.
        See Also:
        Constant Field Values
      • PROTECTED

        public static final int PROTECTED
        The int value representing the protected modifier.
        See Also:
        Constant Field Values
      • STATIC

        public static final int STATIC
        The int value representing the static modifier.
        See Also:
        Constant Field Values
      • FINAL

        public static final int FINAL
        The int value representing the final modifier.
        See Also:
        Constant Field Values
      • SYNCHRONIZED

        public static final int SYNCHRONIZED
        The int value representing the synchronized modifier.
        See Also:
        Constant Field Values
      • VOLATILE

        public static final int VOLATILE
        The int value representing the volatile modifier.
        See Also:
        Constant Field Values
      • TRANSIENT

        public static final int TRANSIENT
        The int value representing the transient modifier.
        See Also:
        Constant Field Values
      • NATIVE

        public static final int NATIVE
        The int value representing the native modifier.
        See Also:
        Constant Field Values
      • INTERFACE

        public static final int INTERFACE
        The int value representing the interface modifier.
        See Also:
        Constant Field Values
      • ABSTRACT

        public static final int ABSTRACT
        The int value representing the abstract modifier.
        See Also:
        Constant Field Values
      • STRICT

        public static final int STRICT
        The int value representing the strictfp modifier.
        See Also:
        Constant Field Values
      • OVERRIDE

        public static final int OVERRIDE
        The int value representing the override modifier.
        See Also:
        Constant Field Values
      • HIDE

        public static final int HIDE
        The int value representing the hide modifier.
        See Also:
        Constant Field Values
      • CLASS_MEMBER

        public static final int CLASS_MEMBER
        The code indicating something is a class member
        See Also:
        Constant Field Values
      • INTERNAL

        public static final int INTERNAL
        The int value representing the internal modifier.
        See Also:
        Constant Field Values
      • REIFIED

        public static final int REIFIED
        The int value representing the reified modifier.
        See Also:
        Constant Field Values
      • DEPRECATED

        public static final int DEPRECATED
        The int value representing the enum modifier. This value should match the Java version of the enum modifier (which isn't publically exposed). Note that the enum modifier may mean different things in different contexts.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Modifier

        public Modifier()
    • Method Detail

      • isPublic

        public static boolean isPublic​(int mod)
        Return true if the integer argument includes the public modifier, false otherwise.
        Parameters:
        mod - a set of modifiers
        Returns:
        true if mod includes the public modifier; false otherwise.
      • isPrivate

        public static boolean isPrivate​(int mod)
        Return true if the integer argument includes the private modifier, false otherwise.
        Parameters:
        mod - a set of modifiers
        Returns:
        true if mod includes the private modifier; false otherwise.
      • isProtected

        public static boolean isProtected​(int mod)
        Return true if the integer argument includes the protected modifier, false otherwise.
        Parameters:
        mod - a set of modifiers
        Returns:
        true if mod includes the protected modifier; false otherwise.
      • isStatic

        public static boolean isStatic​(int mod)
        Return true if the integer argument includes the static modifier, false otherwise.
        Parameters:
        mod - a set of modifiers
        Returns:
        true if mod includes the static modifier; false otherwise.
      • isFinal

        public static boolean isFinal​(int mod)
        Return true if the integer argument includes the final modifier, false otherwise.
        Parameters:
        mod - a set of modifiers
        Returns:
        true if mod includes the final modifier; false otherwise.
      • isSynchronized

        public static boolean isSynchronized​(int mod)
        Return true if the integer argument includes the synchronized modifier, false otherwise.
        Parameters:
        mod - a set of modifiers
        Returns:
        true if mod includes the synchronized modifier; false otherwise.
      • isVolatile

        public static boolean isVolatile​(int mod)
        Return true if the integer argument includes the volatile modifier, false otherwise.
        Parameters:
        mod - a set of modifiers
        Returns:
        true if mod includes the volatile modifier; false otherwise.
      • isTransient

        public static boolean isTransient​(int mod)
        Return true if the integer argument includes the transient modifier, false otherwise.
        Parameters:
        mod - a set of modifiers
        Returns:
        true if mod includes the transient modifier; false otherwise.
      • isNative

        public static boolean isNative​(int mod)
        Return true if the integer argument includes the native modifier, false otherwise.
        Parameters:
        mod - a set of modifiers
        Returns:
        true if mod includes the native modifier; false otherwise.
      • isInterface

        public static boolean isInterface​(int mod)
        Return true if the integer argument includes the interface modifier, false otherwise.
        Parameters:
        mod - a set of modifiers
        Returns:
        true if mod includes the interface modifier; false otherwise.
      • isAbstract

        public static boolean isAbstract​(int mod)
        Return true if the integer argument includes the abstract modifier, false otherwise.
        Parameters:
        mod - a set of modifiers
        Returns:
        true if mod includes the abstract modifier; false otherwise.
      • isStrict

        public static boolean isStrict​(int mod)
        Return true if the integer argument includes the strictfp modifier, false otherwise.
        Parameters:
        mod - a set of modifiers
        Returns:
        true if mod includes the strictfp modifier; false otherwise.
      • toString

        public static String toString​(int mod)
        Return a string describing the access modifier flags in the specified modifier. For example:
            public final synchronized strictfp
         
        The modifier names are returned in an order consistent with the suggested modifier orderings given in sections 8.1.1, 8.3.1, 8.4.3, 8.8.3, and 9.1.1 of The Java Language Specification. The full modifier ordering used by this method is:
        public protected private abstract static final transient volatile synchronized native strictfp interface
        The interface modifier discussed in this class is not a true modifier in the Java language and it appears after all other modifiers listed by this method. This method may return a string of modifiers that are not valid modifiers of a Java entity; in other words, no checking is done on the possible validity of the combination of modifiers represented by the input. Note that to perform such checking for a known kind of entity, such as a constructor or method, first AND the argument of toString with the appropriate mask from a method like constructorModifiers() or methodModifiers().
        Parameters:
        mod - a set of modifiers
        Returns:
        a string representation of the set of modifiers represented by mod
      • isSynthetic

        public static boolean isSynthetic​(int mod)
      • isMandated

        public static boolean isMandated​(int mod)
      • classModifiers

        public static int classModifiers()
        Return an int value OR-ing together the source language modifiers that can be applied to a class.
        Returns:
        an int value OR-ing together the source language modifiers that can be applied to a class.
        Since:
        1.7
      • interfaceModifiers

        public static int interfaceModifiers()
        Return an int value OR-ing together the source language modifiers that can be applied to an interface.
        Returns:
        an int value OR-ing together the source language modifiers that can be applied to an interface.
        Since:
        1.7
      • constructorModifiers

        public static int constructorModifiers()
        Return an int value OR-ing together the source language modifiers that can be applied to a constructor.
        Returns:
        an int value OR-ing together the source language modifiers that can be applied to a constructor.
        Since:
        1.7
      • methodModifiers

        public static int methodModifiers()
        Return an int value OR-ing together the source language modifiers that can be applied to a method.
        Returns:
        an int value OR-ing together the source language modifiers that can be applied to a method.
        Since:
        1.7
      • fieldModifiers

        public static int fieldModifiers()
        Return an int value OR-ing together the source language modifiers that can be applied to a field.
        Returns:
        an int value OR-ing together the source language modifiers that can be applied to a field.
        Since:
        1.7
      • parameterModifiers

        public static int parameterModifiers()
        Return an int value OR-ing together the source language modifiers that can be applied to a parameter.
        Returns:
        an int value OR-ing together the source language modifiers that can be applied to a parameter.
        Since:
        1.8
      • isHide

        public static boolean isHide​(int mod)
        Return true if the integer argument includes the hide modifer, false otherwise.
        Parameters:
        mod - a set of modifers
        Returns:
        true if mod includes the hide modifier; false otherwise.
      • isOverride

        public static boolean isOverride​(int mod)
        Return true if the integer argument includes the override modifer, false otherwise.
        Parameters:
        mod - a set of modifers
        Returns:
        true if mod includes the override modifier; false otherwise.
      • isClassMember

        public static boolean isClassMember​(int mod)
        Return true if the integer argument includes the class member modifer, false otherwise.
        Parameters:
        mod - a set of modifers
        Returns:
        true if mod includes the class member modifier; false otherwise.
      • isInternal

        public static boolean isInternal​(int mod)
        Return true if the integer argument includes the internal modifer, false otherwise.
        Parameters:
        mod - a set of modifers
        Returns:
        true if mod includes the internal modifier; false otherwise.
      • isEnum

        public static boolean isEnum​(int mod)
        Return true if the integer argument includes the enum modifer, false otherwise.
        Parameters:
        mod - a set of modifers
        Returns:
        true if mod includes the enum modifier; false otherwise.
      • isDeprecated

        public static boolean isDeprecated​(int mod)
      • isAnnotation

        public static boolean isAnnotation​(int mod)
      • isReified

        public static boolean isReified​(int mod)
      • setPublic

        public static int setPublic​(int mod,
                                    boolean bValue)
      • setPrivate

        public static int setPrivate​(int mod,
                                     boolean bValue)
      • setProtected

        public static int setProtected​(int mod,
                                       boolean bValue)
      • setStatic

        public static int setStatic​(int mod,
                                    boolean bValue)
      • setAbstract

        public static int setAbstract​(int mod,
                                      boolean bValue)
      • setFinal

        public static int setFinal​(int mod,
                                   boolean bValue)
      • setOverride

        public static int setOverride​(int mod,
                                      boolean bValue)
      • setHide

        public static int setHide​(int mod,
                                  boolean bValue)
      • setClassMember

        public static int setClassMember​(int mod,
                                         boolean bValue)
      • setTransient

        public static int setTransient​(int mod,
                                       boolean bValue)
      • setInternal

        public static int setInternal​(int mod,
                                      boolean bValue)
      • setEnum

        public static int setEnum​(int mod,
                                  boolean bValue)
      • setDeprecated

        public static int setDeprecated​(int mod,
                                        boolean bValue)
      • setReified

        public static int setReified​(int mod,
                                     boolean bValue)
      • toModifierString

        public static String toModifierString​(int mod)