Which is the objective of the method getDefaultValue() in class java.lang.reflect.Method ?, can someone point me out a situation where this method is useful ?.
The description from the API of Method does not say a lot to me, I do not get what is the “annotation member represented by this Method instance” :
Returns the default value for the annotation member represented by this Method instance. If the member is of a primitive type, an instance of the corresponding wrapper type is returned. Returns null if no default is associated with the member, or if the method instance does not represent a declared member of an annotation type.
Annotations have their “attributes” as methods. For instance:
The
getDefaultValue()of a Method from an annotation returns the default value of an annotation “attribute” defined this way. In the example, the default value of the MethodstringValue()is"string default value".