class BenchmarkGeneratorUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static Multimap<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.ElementType> |
JMH_ANNOTATION_TARGETS |
private static java.util.Collection<java.lang.Class<? extends java.lang.annotation.Annotation>> |
JMH_ANNOTATIONS |
Constructor and Description |
---|
BenchmarkGeneratorUtils() |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
addParameterValuesToGroup(ClassInfo host,
MethodGroup group)
Compute the parameter space given by
@Param annotations and add all them to the group. |
static void |
checkAnnotations(ClassInfo ci) |
static void |
checkAnnotations(FieldInfo fi) |
static void |
checkAnnotations(MethodInfo mi) |
static boolean |
checkJavaIdentifier(java.lang.String id) |
static java.util.Collection<FieldInfo> |
getAllFields(ClassInfo ci) |
static java.util.Collection<MethodInfo> |
getAllMethods(ClassInfo ci) |
static <T extends java.lang.annotation.Annotation> |
getAnnSuper(ClassInfo ci,
java.lang.Class<T> annClass) |
static <T extends java.lang.annotation.Annotation> |
getAnnSuper(MethodInfo mi,
java.lang.Class<T> annClass) |
static <T extends java.lang.annotation.Annotation> |
getAnnSuper(MethodInfo mi,
ClassInfo startCi,
java.lang.Class<T> annClass) |
static <T extends java.lang.annotation.Annotation> |
getAnnSuperAll(MethodInfo mi,
ClassInfo startCi,
java.lang.Class<T> annClass) |
static <T extends java.lang.annotation.Annotation> |
getAnnSyntax(ClassInfo ci,
java.lang.Class<T> annClass) |
static <T extends java.lang.annotation.Annotation> |
getAnnSyntax(MethodInfo mi,
java.lang.Class<T> annClass) |
static <T extends java.lang.annotation.Annotation> |
getClassesAnnotatedWith(GeneratorSource source,
java.lang.Class<T> annClass) |
static <T extends java.lang.annotation.Annotation> |
getFieldsAnnotatedWith(GeneratorSource source,
java.lang.Class<T> annClass) |
static java.lang.String |
getGeneratedName(ClassInfo ci) |
static java.util.Collection<MethodInfo> |
getMethods(ClassInfo ci) |
static <T extends java.lang.annotation.Annotation> |
getMethodsAnnotatedWith(GeneratorSource source,
java.lang.Class<T> annClass) |
static java.lang.String |
getNestedNames(ClassInfo ci) |
private static java.lang.String[] |
toParameterValues(FieldInfo fi)
Gets the parameter values to be used for this field.
|
private static final java.util.Collection<java.lang.Class<? extends java.lang.annotation.Annotation>> JMH_ANNOTATIONS
private static final Multimap<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.ElementType> JMH_ANNOTATION_TARGETS
public static boolean checkJavaIdentifier(java.lang.String id)
public static <T extends java.lang.annotation.Annotation> java.util.Collection<MethodInfo> getMethodsAnnotatedWith(GeneratorSource source, java.lang.Class<T> annClass)
public static <T extends java.lang.annotation.Annotation> java.util.Collection<ClassInfo> getClassesAnnotatedWith(GeneratorSource source, java.lang.Class<T> annClass)
public static <T extends java.lang.annotation.Annotation> java.util.Collection<FieldInfo> getFieldsAnnotatedWith(GeneratorSource source, java.lang.Class<T> annClass)
public static java.util.Collection<MethodInfo> getAllMethods(ClassInfo ci)
public static java.util.Collection<MethodInfo> getMethods(ClassInfo ci)
public static <T extends java.lang.annotation.Annotation> T getAnnSuper(ClassInfo ci, java.lang.Class<T> annClass)
public static <T extends java.lang.annotation.Annotation> T getAnnSyntax(ClassInfo ci, java.lang.Class<T> annClass)
public static <T extends java.lang.annotation.Annotation> T getAnnSyntax(MethodInfo mi, java.lang.Class<T> annClass)
public static <T extends java.lang.annotation.Annotation> T getAnnSuper(MethodInfo mi, java.lang.Class<T> annClass)
public static <T extends java.lang.annotation.Annotation> T getAnnSuper(MethodInfo mi, ClassInfo startCi, java.lang.Class<T> annClass)
public static <T extends java.lang.annotation.Annotation> java.util.Collection<T> getAnnSuperAll(MethodInfo mi, ClassInfo startCi, java.lang.Class<T> annClass)
public static java.lang.String getGeneratedName(ClassInfo ci)
public static java.lang.String getNestedNames(ClassInfo ci)
public static void checkAnnotations(FieldInfo fi)
public static void checkAnnotations(ClassInfo ci)
public static void checkAnnotations(MethodInfo mi)
private static java.lang.String[] toParameterValues(FieldInfo fi)
Gets the parameter values to be used for this field. In most cases this will be the values declared
in the @Param
annotation.
For an enum field type, an empty parameter list will be resolved to be the full list of enum constants of that type.
fi
- type of the field for which to find parametersstatic void addParameterValuesToGroup(ClassInfo host, MethodGroup group)
@Param
annotations and add all them to the group.host
- type of the state @State
in which to find @Param
sgroup
- method group