Package org.openjdk.jmh.generators.core
Class BenchmarkGeneratorUtils
- java.lang.Object
-
- org.openjdk.jmh.generators.core.BenchmarkGeneratorUtils
-
class BenchmarkGeneratorUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description BenchmarkGeneratorUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method 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>
TgetAnnSuper(ClassInfo ci, java.lang.Class<T> annClass)
static <T extends java.lang.annotation.Annotation>
TgetAnnSuper(MethodInfo mi, java.lang.Class<T> annClass)
static <T extends java.lang.annotation.Annotation>
TgetAnnSuper(MethodInfo mi, ClassInfo startCi, java.lang.Class<T> annClass)
static <T extends java.lang.annotation.Annotation>
java.util.Collection<T>getAnnSuperAll(MethodInfo mi, ClassInfo startCi, java.lang.Class<T> annClass)
static <T extends java.lang.annotation.Annotation>
TgetAnnSyntax(ClassInfo ci, java.lang.Class<T> annClass)
static <T extends java.lang.annotation.Annotation>
TgetAnnSyntax(MethodInfo mi, java.lang.Class<T> annClass)
static <T extends java.lang.annotation.Annotation>
java.util.Collection<ClassInfo>getClassesAnnotatedWith(GeneratorSource source, java.lang.Class<T> annClass)
static <T extends java.lang.annotation.Annotation>
java.util.Collection<FieldInfo>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>
java.util.Collection<MethodInfo>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.
-
-
-
Field Detail
-
JMH_ANNOTATIONS
private static final java.util.Collection<java.lang.Class<? extends java.lang.annotation.Annotation>> JMH_ANNOTATIONS
-
JMH_ANNOTATION_TARGETS
private static final Multimap<java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.ElementType> JMH_ANNOTATION_TARGETS
-
-
Method Detail
-
checkJavaIdentifier
public static boolean checkJavaIdentifier(java.lang.String id)
-
getMethodsAnnotatedWith
public static <T extends java.lang.annotation.Annotation> java.util.Collection<MethodInfo> getMethodsAnnotatedWith(GeneratorSource source, java.lang.Class<T> annClass)
-
getClassesAnnotatedWith
public static <T extends java.lang.annotation.Annotation> java.util.Collection<ClassInfo> getClassesAnnotatedWith(GeneratorSource source, java.lang.Class<T> annClass)
-
getFieldsAnnotatedWith
public static <T extends java.lang.annotation.Annotation> java.util.Collection<FieldInfo> getFieldsAnnotatedWith(GeneratorSource source, java.lang.Class<T> annClass)
-
getAllMethods
public static java.util.Collection<MethodInfo> getAllMethods(ClassInfo ci)
-
getMethods
public static java.util.Collection<MethodInfo> getMethods(ClassInfo ci)
-
getAnnSuper
public static <T extends java.lang.annotation.Annotation> T getAnnSuper(ClassInfo ci, java.lang.Class<T> annClass)
-
getAnnSyntax
public static <T extends java.lang.annotation.Annotation> T getAnnSyntax(ClassInfo ci, java.lang.Class<T> annClass)
-
getAnnSyntax
public static <T extends java.lang.annotation.Annotation> T getAnnSyntax(MethodInfo mi, java.lang.Class<T> annClass)
-
getAnnSuper
public static <T extends java.lang.annotation.Annotation> T getAnnSuper(MethodInfo mi, java.lang.Class<T> annClass)
-
getAnnSuper
public static <T extends java.lang.annotation.Annotation> T getAnnSuper(MethodInfo mi, ClassInfo startCi, java.lang.Class<T> annClass)
-
getAnnSuperAll
public static <T extends java.lang.annotation.Annotation> java.util.Collection<T> getAnnSuperAll(MethodInfo mi, ClassInfo startCi, java.lang.Class<T> annClass)
-
getGeneratedName
public static java.lang.String getGeneratedName(ClassInfo ci)
-
getNestedNames
public static java.lang.String getNestedNames(ClassInfo ci)
-
checkAnnotations
public static void checkAnnotations(FieldInfo fi)
-
checkAnnotations
public static void checkAnnotations(ClassInfo ci)
-
checkAnnotations
public static void checkAnnotations(MethodInfo mi)
-
toParameterValues
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.
- Parameters:
fi
- type of the field for which to find parameters- Returns:
- string values representing the actual parameters
-
addParameterValuesToGroup
static void addParameterValuesToGroup(ClassInfo host, MethodGroup group)
Compute the parameter space given by@Param
annotations and add all them to the group.- Parameters:
host
- type of the state@State
in which to find@Param
sgroup
- method group
-
-