private Message getMessage(Method method, Protocol protocol, Map<String,Schema> names) { List<Schema.Field> fields = new ArrayList<Schema.Field>(); String[] paramNames = paranamer.lookupParameterNames(method); Type[] paramTypes = method.getGenericParameterTypes(); Annotation[][] annotations = method.getParameterAnnotations();
/** * Use DefaultParanamer ahead of BytecodeReadingParanamer */ public AdaptiveParanamer() { this(new DefaultParanamer(), new BytecodeReadingParanamer()); }
protected Paranamer getParanamer() { if (paranamer == null) { paranamer = new CachingParanamer(new AnnotationParanamer(new AdaptiveParanamer())); } return paranamer; }
public SimpleConstructorResolverStrategy() { paranamer = new CachingParanamer(new AdaptiveParanamer(new BytecodeReadingParanamer(), new AnnotationParanamer())); }
/** * Default constructor using a custom annotation paranmer as first-priority provider. */ public JaxRsParameterNameProvider() { super(new CachingParanamer(new AdaptiveParanamer(new JaxRsAnnotationParanamer(), new DefaultParanamer(), new BytecodeReadingParanamer()))); }
/** * @param method 目标方法 * @return 获取方法的参数名集合,若找不到则返回元素数量为0的空数组 */ public static String[] getMethodParamNames(final Method method) { return new AdaptiveParanamer().lookupParameterNames(method, false); }
@Override protected boolean isNamed(Annotation annotation) { return annotation instanceof ThriftField || super.isNamed(annotation); } }
/** * Returns the type of the elements of this array type. This method should * only be used for an array type. * * @return Returns the type of the elements of this array type. */ private Type getElementType() { return getType(buf, off + getDimensions()); }
/** * Uses a DefaultParanamer as the implementation it delegates to. */ public CachingParanamer() { this(new DefaultParanamer()); }
public String[] lookupParameterNames(AccessibleObject methodOrConstructor, boolean throwExceptionIfMissing) { if (throwExceptionIfMissing) { throw new ParameterNamesNotFoundException("NullParanamer implementation predictably finds no parameter names"); } return Paranamer.EMPTY_NAMES; } }
/** * Constructs a new {@link ClassReader} object. * * @param is an input stream from which to read the class. * @throws IOException if a problem occurs during reading. */ private ClassReader(final InputStream is) throws IOException { this(readClass(is)); }
/** * @param url base URL of the JavaDocs * @throws FileNotFoundException if the url does not have a <code>/package-list</code> */ public JavadocParanamer(URL url) throws IOException { this.provider = new UrlJavadocProvider(url); }
public String[] lookupParameterNames(AccessibleObject methodOrCtor, boolean throwExceptionIfMissing) { int count = count(methodOrCtor); String[] result = new String[count]; for (int i = 0; i < result.length; i++) { result[i] = prefix + i; } return result; }
String[] names = builder.getParanamer().lookupParameterNames(method, false); Type[] types = method.getGenericParameterTypes(); parameters = new ParameterData[types.length];
/** * @param method 目标方法 * @return 获取方法的参数名集合,若找不到则返回元素数量为0的空数组 */ public static String[] getMethodParamNames(final Method method) { return new AdaptiveParanamer().lookupParameterNames(method, false); }
/** * Use DefaultParanamer ahead of BytecodeReadingParanamer */ public AdaptiveParanamer() { this(new DefaultParanamer(), new BytecodeReadingParanamer()); }
/** * Uses a DefaultParanamer as the implementation it delegates to. */ public CachingParanamer() { this(new DefaultParanamer()); }
/** * Constructs a new {@link ClassReader} object. * * @param is an input stream from which to read the class. * @throws IOException if a problem occurs during reading. */ private ClassReader(final InputStream is) throws IOException { this(readClass(is)); }
public static String[] extractParameterNames(AccessibleObject methodOrConstructor) { String[] names = PARANAMER.lookupParameterNames(methodOrConstructor); return names; }
public String[] lookupParameterNames(AccessibleObject methodOrCtor, boolean throwExceptionIfMissing) { for (int i = 0; i < paranamers.length; i++) { Paranamer paranamer = paranamers[i]; String[] names = paranamer.lookupParameterNames(methodOrCtor, i+1 < paranamers.length ? false : throwExceptionIfMissing); if (names != Paranamer.EMPTY_NAMES) { return names; } } return Paranamer.EMPTY_NAMES; }