com.dslplatform.json.runtime.ParanamerParameterNameExtractor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dsl-json-java8 Show documentation
Show all versions of dsl-json-java8 Show documentation
DSL Platform compatible Java JSON library (https://dsl-platform.com)
package com.dslplatform.json.runtime;
import com.dslplatform.json.Nullable;
import com.thoughtworks.paranamer.AdaptiveParanamer;
import com.thoughtworks.paranamer.Paranamer;
import java.lang.reflect.AccessibleObject;
class ParanamerParameterNameExtractor implements ParameterNameExtractor {
private final Paranamer paranamer = new AdaptiveParanamer();
@Nullable
@Override
public String[] extractNames(AccessibleObject ctorOrMethod) {
String[] names = paranamer.lookupParameterNames(ctorOrMethod, false);
return names == Paranamer.EMPTY_NAMES ? null : names;
}
}