Class MethodDescriptor
- java.lang.Object
-
- com.univocity.parsers.annotations.helpers.MethodDescriptor
-
public final class MethodDescriptor extends java.lang.ObjectA very basic descriptor or getter/setter methods
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringnameprivate java.lang.Class<?>parameterTypeprivate java.lang.Stringprefixprivate java.lang.StringprefixedNameprivate java.lang.Class<?>returnTypeprivate java.lang.Stringstring
-
Constructor Summary
Constructors Modifier Constructor Description privateMethodDescriptor(java.lang.String name, java.lang.Class<?> parameterType, java.lang.Class<?> returnType)privateMethodDescriptor(java.lang.String prefix, java.lang.String name, java.lang.Class<?> parameterType, java.lang.Class<?> returnType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)private java.lang.StringgenerateString()java.lang.StringgetName()Returns the method name, without the prefixjava.lang.Class<?>getParameterType()Returns the parameter type associated with a method, if availablejava.lang.StringgetPrefix()Returns the prefix: a dot separated string denoting a path of nested object names (e.g.java.lang.StringgetPrefixedName()Returns full path to a method, (e.g.java.lang.Class<?>getReturnType()Returns the return type associated with a method, if availablestatic MethodDescriptorgetter(java.lang.String name, java.lang.Class<?> returnType)Creates a descriptor for a getter method(package private) static MethodDescriptorgetter(java.lang.String prefix, java.lang.reflect.Method method)Creates a descriptor for a getter methodinthashCode()static MethodDescriptorsetter(java.lang.String name, java.lang.Class<?> parameterType)Creates a descriptor for a setter method(package private) static MethodDescriptorsetter(java.lang.String prefix, java.lang.reflect.Method method)Creates a descriptor for a setter methodjava.lang.StringtoString()
-
-
-
Field Detail
-
prefixedName
private final java.lang.String prefixedName
-
name
private final java.lang.String name
-
prefix
private final java.lang.String prefix
-
parameterType
private final java.lang.Class<?> parameterType
-
returnType
private final java.lang.Class<?> returnType
-
string
private final java.lang.String string
-
-
Constructor Detail
-
MethodDescriptor
private MethodDescriptor(java.lang.String name, java.lang.Class<?> parameterType, java.lang.Class<?> returnType)
-
MethodDescriptor
private MethodDescriptor(java.lang.String prefix, java.lang.String name, java.lang.Class<?> parameterType, java.lang.Class<?> returnType)
-
-
Method Detail
-
generateString
private java.lang.String generateString()
-
setter
public static MethodDescriptor setter(java.lang.String name, java.lang.Class<?> parameterType)
Creates a descriptor for a setter method- Parameters:
name- name of the setter methodparameterType- the parameter type accepted by the given setter method- Returns:
- a "setter" method descriptor
-
getter
public static MethodDescriptor getter(java.lang.String name, java.lang.Class<?> returnType)
Creates a descriptor for a getter method- Parameters:
name- name of the getter methodreturnType- the return type of the given getter method- Returns:
- a "getter" method descriptor
-
setter
static MethodDescriptor setter(java.lang.String prefix, java.lang.reflect.Method method)
Creates a descriptor for a setter method- Parameters:
prefix- a dot separated string denoting a path of nested object namesmethod- a actual class method to be associated with this prefix- Returns:
- a "setter" method descriptor
-
getter
static MethodDescriptor getter(java.lang.String prefix, java.lang.reflect.Method method)
Creates a descriptor for a getter method- Parameters:
prefix- a dot separated string denoting a path of nested object namesmethod- a actual class method to be associated with this prefix- Returns:
- a "getter" method descriptor
-
getName
public java.lang.String getName()
Returns the method name, without the prefix- Returns:
- the method name
-
getPrefix
public java.lang.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 java.lang.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
nullif a getter is being represented.
-
getReturnType
public java.lang.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
nullif a setter is being represented.
-
getPrefixedName
public java.lang.String getPrefixedName()
Returns full path to a method, (e.g.getNameorperson.getName- Returns:
- the path to the given method.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-