io.airlift:parameternames

Utility methods for fetching the parameter names for a method or constructor

Лицензия

Лицензия

Группа

Группа

io.airlift
Идентификатор

Идентификатор

parameternames
Последняя версия

Последняя версия

1.5
Дата

Дата

Тип

Тип

jar
Описание

Описание

Utility methods for fetching the parameter names for a method or constructor
Ссылка на сайт

Ссылка на сайт

https://github.com/airlift/parameternames
Система контроля версий

Система контроля версий

https://github.com/airlift/parameternames

Скачать parameternames

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/io.airlift/parameternames/ -->
<dependency>
    <groupId>io.airlift</groupId>
    <artifactId>parameternames</artifactId>
    <version>1.5</version>
</dependency>
// https://jarcasting.com/artifacts/io.airlift/parameternames/
implementation 'io.airlift:parameternames:1.5'
// https://jarcasting.com/artifacts/io.airlift/parameternames/
implementation ("io.airlift:parameternames:1.5")
'io.airlift:parameternames:jar:1.5'
<dependency org="io.airlift" name="parameternames" rev="1.5">
  <artifact name="parameternames" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.airlift', module='parameternames', version='1.5')
)
libraryDependencies += "io.airlift" % "parameternames" % "1.5"
[io.airlift/parameternames "1.5"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

Parameter Names

Maven Central Build Status

Parameter Names contains utility methods for fetching the parameter names for a method or constructor.

Java 8 added the ability to access the parameter names of a method or constructor, but this only works if the code was compiled with the Java 8 version of javac with the -parameters option enabled. This utility falls back to reading parameters from the debug symbols in the method bytecode for classes compiled without the -parameters option enabled. Note that this fallback will not work for interfaces, as interface methods do not have bytecode and thus do not have debug symbols.

Usage

Simply, pass java.lang.reflect.Method or java.lang.reflect.Constructor to ParameterNames.getParameterNames. For example:

    Method method = ParameterNames.class.getMethod("getParameterNames", Executable.class);
    List<String> parameterNames = ParameterNames.getParameterNames(method);

Parameter names are loaded in the following order:

  1. Java 8 reflection names created by javac with the -parameters option
  2. Bytecode debug symbols created by javac with the -g option
  3. Default name of argN where N is the index of the parameter starting from zero

Maven Dependency

<dependency>
    <groupId>io.airlift</groupId>
    <artifactId>parameternames</artifactId>
    <version>1.0</version>
</dependency>

License

Parameter Names is released under the Apache License, Version 2.0.

io.airlift

Версии библиотеки

Версия
1.5
1.4
1.3
1.2
1.1
1.0