Enum MethodType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<MethodType>

    enum MethodType
    extends java.lang.Enum<MethodType>
    The MethodType enumeration is used to specify a set of types that can be used to classify Java Beans methods. This creates three types for the get, is, and set methods. The method types allow the MethodScanner to determine what function the method has in creating a contact point for the object. This also enables methods to be parsed correctly.
    See Also:
    MethodScanner, MethodPart
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      GET
      This is used to represent a method that acts as a getter.
      IS
      This is used to represent a method that acts as a getter.
      NONE
      This is used to represent a a normal method to be ignored.
      SET
      This is used to represent a method that acts as a setter.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int prefix
      This is the length of the prefix the method type uses.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private MethodType​(int prefix)
      Constructor for the MethodType object.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getPrefix()
      This is used to acquire the prefix for the method type.
      static MethodType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static MethodType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • GET

        public static final MethodType GET
        This is used to represent a method that acts as a getter.
      • IS

        public static final MethodType IS
        This is used to represent a method that acts as a getter.
      • SET

        public static final MethodType SET
        This is used to represent a method that acts as a setter.
      • NONE

        public static final MethodType NONE
        This is used to represent a a normal method to be ignored.
    • Field Detail

      • prefix

        private int prefix
        This is the length of the prefix the method type uses.
    • Constructor Detail

      • MethodType

        private MethodType​(int prefix)
        Constructor for the MethodType object. This is used to create a method type specifying the length of the prefix. This allows the method name to be parsed easily.
        Parameters:
        prefix - this is the length of the method name prefix
    • Method Detail

      • values

        public static MethodType[] 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 (MethodType c : MethodType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MethodType valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getPrefix

        public int getPrefix()
        This is used to acquire the prefix for the method type. The prefix allows the method name to be extracted easily as it is used to determine the character range that forms the name.
        Returns:
        this returns the method name prefix for the type