public final class ParameterNames extends Object
-parameters flag to javac or
from the debug symbols in the class file.| Modifier and Type | Method and Description |
|---|---|
static List<String> |
getParameterNames(Executable executable)
Gets the parameter names of the method or constructor.
|
static Optional<List<String>> |
getParameterNamesFromBytecode(Executable executable)
Gets the parameter names of the method or constructor from the debug symbols in the bytecode.
|
static Optional<List<String>> |
tryGetParameterNames(Executable executable)
Tries to get meaningful parameter names of the method or constructor.
|
public static Optional<List<String>> tryGetParameterNames(Executable executable)
-parameters flag to javac, the parameters
are fetch via Java reflection. Otherwise, the parameters are read from the debug symbols in the class
file. If the method does not have debug symbols, empty result is returned.executable - the method or constructorpublic static List<String> getParameterNames(Executable executable)
-parameters flag to javac, the parameters are fetch
via Java reflection. Otherwise, the parameters are read from the debug symbols in the class
file. If the method does not have debug symbols, the default parameter names argN
are returned.executable - the method or constructorpublic static Optional<List<String>> getParameterNamesFromBytecode(Executable executable)
executable - the method or constructorCopyright © 2015-2019. All Rights Reserved.