Class MethodDescriptor

java.lang.Object
com.univocity.parsers.annotations.helpers.MethodDescriptor

public final class MethodDescriptor extends Object
A very basic descriptor or getter/setter methods
  • Field Details

    • prefixedName

      private final String prefixedName
    • name

      private final String name
    • prefix

      private final String prefix
    • parameterType

      private final Class<?> parameterType
    • returnType

      private final Class<?> returnType
    • string

      private final String string
  • Constructor Details

    • MethodDescriptor

      private MethodDescriptor(String name, Class<?> parameterType, Class<?> returnType)
    • MethodDescriptor

      private MethodDescriptor(String prefix, String name, Class<?> parameterType, Class<?> returnType)
  • Method Details

    • generateString

      private String generateString()
    • setter

      public static MethodDescriptor setter(String name, Class<?> parameterType)
      Creates a descriptor for a setter method
      Parameters:
      name - name of the setter method
      parameterType - the parameter type accepted by the given setter method
      Returns:
      a "setter" method descriptor
    • getter

      public static MethodDescriptor getter(String name, Class<?> returnType)
      Creates a descriptor for a getter method
      Parameters:
      name - name of the getter method
      returnType - the return type of the given getter method
      Returns:
      a "getter" method descriptor
    • setter

      static MethodDescriptor setter(String prefix, Method method)
      Creates a descriptor for a setter method
      Parameters:
      prefix - a dot separated string denoting a path of nested object names
      method - a actual class method to be associated with this prefix
      Returns:
      a "setter" method descriptor
    • getter

      static MethodDescriptor getter(String prefix, Method method)
      Creates a descriptor for a getter method
      Parameters:
      prefix - a dot separated string denoting a path of nested object names
      method - a actual class method to be associated with this prefix
      Returns:
      a "getter" method descriptor
    • getName

      public String getName()
      Returns the method name, without the prefix
      Returns:
      the method name
    • getPrefix

      public String getPrefix()
      Returns the prefix: a dot separated string denoting a path of nested object names (e.g. customer.contact).
      Returns:
      the object nesting path associated with a method.
    • getParameterType

      public Class<?> getParameterType()
      Returns the parameter type associated with a method, if available
      Returns:
      the type of parameter accepted by this method if it is a setter, or null if a getter is being represented.
    • getReturnType

      public Class<?> getReturnType()
      Returns the return type associated with a method, if available
      Returns:
      the return type of this method if it is a getter, or null if a setter is being represented.
    • getPrefixedName

      public String getPrefixedName()
      Returns full path to a method, (e.g. getName or person.getName
      Returns:
      the path to the given method.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object