List of usage examples for java.lang.reflect Parameter getDeclaredAnnotation
public <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass)
From source file:telegram.polling.BotApiProxy.java
@Override public Object invoke(Object o, Method method, Object[] os) throws Throwable { ArrayList<NameValuePair> nvps = new ArrayList<>(); for (int i = 0; i < method.getParameterCount(); i++) { Parameter parameter = method.getParameters()[i]; if (os[i] != null) { String name;//from w w w . j av a 2 s .c o m if (parameter.isAnnotationPresent(Param.class)) { name = parameter.getDeclaredAnnotation(Param.class).name(); } else { name = parameter.getName(); } nvps.add(new BasicNameValuePair(name, os[i].toString())); } } return callApiMethod(method.getName(), nvps, method.getReturnType()); }