Skip to content

Commit 0ebee59

Browse files
committed
Update MethodDefinition.java
1 parent 5dd21cb commit 0ebee59

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

microsphere-java-core/src/main/java/io/microsphere/reflect/MethodDefinition.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,25 @@
2929
import static io.microsphere.util.ArrayUtils.arrayToString;
3030

3131
/**
32-
* The definition class of Java {@link Method}
32+
* The definition class of Java {@link Method}, providing a structured way to define and resolve methods
33+
* by their name, parameter types, and declaring class. This class serves as a convenient wrapper for
34+
* method metadata and resolution logic.
3335
*
34-
* @author <a href="mailto:mercyblitz@gmail.com">Mercy<a/>
36+
* <h3>Usage Example</h3>
37+
* <pre>{@code
38+
* // Define a method without deprecation information
39+
* MethodDefinition methodDef = new MethodDefinition("1.0.0", "com.example.MyClass", "myMethod", "java.lang.String", "int");
40+
*
41+
* // Define a deprecated method
42+
* Deprecation deprecation = new Deprecation("2.0.0", "Use newMethod instead.");
43+
* MethodDefinition deprecatedMethodDef = new MethodDefinition("1.0.0", deprecation, "com.example.MyClass", "oldMethod", "java.util.List");
44+
*
45+
* // Resolve and invoke the method
46+
* Method method = methodDef.getMethod(); // May return null if not found
47+
* String result = methodDef.invoke(instance, "example", 42); // Invokes myMethod with String and int parameters
48+
* }</pre>
49+
*
50+
* @author <a href="mailto:mercyblitz@gmail.com">Mercy</a>
3551
* @see Method
3652
* @see Version
3753
* @since 1.0.0

0 commit comments

Comments
 (0)