Class JMod


  • public final class JMod
    extends java.lang.Object
    The set of modifiers for types and members.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ABSTRACT
      The abstract modifier.
      static int DEFAULT
      The default modifier found in Java 8 and later.
      static int FINAL
      The final modifier.
      (package private) static int INNER  
      static int NATIVE
      The native modifier.
      static int PRIVATE
      The private modifier.
      (package private) static int PRIVATE_BITS  
      static int PROTECTED
      The protected modifier.
      static int PUBLIC
      The public modifier.
      static int STATIC
      The static modifier.
      static int STRICTFP
      The strictfp modifier.
      static int SYNCHRONIZED
      The synchronized modifier.
      static int TRANSIENT
      The transient modifier.
      (package private) static int VARARGS  
      static int VOLATILE
      The volatile modifier.
    • Constructor Summary

      Constructors 
      Constructor Description
      JMod()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean allAreClear​(int set, int test)
      Test to see if all modifiers in the given set are absent in the test value.
      static boolean allAreSet​(int set, int test)
      Test to see if all modifiers in the given set are present in the test value.
      static boolean anyAreClear​(int set, int test)
      Test to see if any of the modifiers in the given set are absent in the test value.
      static boolean anyAreSet​(int set, int test)
      Test to see if any of the modifiers in the given set are present in the test value.
      static int of​(javax.lang.model.element.Element element)
      Returns an integer which results in the appropriate modifier based on the element.
      static boolean oneIsSet​(int set, int test)
      Test to see if exactly one modifier of the given set is present in the test value.
      (package private) static void write​(SourceFileWriter writer, int mods)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JMod

        public JMod()
    • Method Detail

      • oneIsSet

        public static boolean oneIsSet​(int set,
                                       int test)
        Test to see if exactly one modifier of the given set is present in the test value.
        Parameters:
        set - the set of modifiers to test against
        test - the modifier set to test
        Returns:
        true if exactly one of set is present in test, false otherwise
      • allAreSet

        public static boolean allAreSet​(int set,
                                        int test)
        Test to see if all modifiers in the given set are present in the test value.
        Parameters:
        set - the set of modifiers to test against
        test - the modifier set to test
        Returns:
        true if all the modifiers in set are present in test, false otherwise
      • allAreClear

        public static boolean allAreClear​(int set,
                                          int test)
        Test to see if all modifiers in the given set are absent in the test value.
        Parameters:
        set - the set of modifiers to test against
        test - the modifier set to test
        Returns:
        true if all the modifiers in set are absent in test, false otherwise
      • anyAreSet

        public static boolean anyAreSet​(int set,
                                        int test)
        Test to see if any of the modifiers in the given set are present in the test value.
        Parameters:
        set - the set of modifiers to test against
        test - the modifier set to test
        Returns:
        true if any of the modifiers in set are present in test, false otherwise
      • anyAreClear

        public static boolean anyAreClear​(int set,
                                          int test)
        Test to see if any of the modifiers in the given set are absent in the test value.
        Parameters:
        set - the set of modifiers to test against
        test - the modifier set to test
        Returns:
        true if any of the modifiers in set are absent in test, false otherwise
      • of

        public static int of​(javax.lang.model.element.Element element)
        Returns an integer which results in the appropriate modifier based on the element.
        Parameters:
        element - the element to check the modifiers on
        Returns:
        an integer representing the modifiers
      • write

        static void write​(SourceFileWriter writer,
                          int mods)
                   throws java.io.IOException
        Throws:
        java.io.IOException