Class ReflectionUtilsPredicates
java.lang.Object
org.reflections.util.ReflectionUtilsPredicates
- Direct Known Subclasses:
ReflectionUtils
helper predicates for java meta types
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Class<? extends Annotation>[]annotationTypes(Annotation[] annotations) private static Set<Class<? extends Annotation>> annotationTypes(Collection<Annotation> annotations) private static booleanareAnnotationMembersMatching(Annotation annotation1, Annotation annotation2) static booleanisAssignable(Class[] childClasses, Class[] parentClasses) private static Set<Annotation> parameterAnnotations(Member member) private static Class[]parameterTypes(Member member) private static Stringstatic <T extends AnnotatedElement>
Predicate<T> withAnnotation(Annotation annotation) where element is annotated with givenannotation, including member matchingstatic <T extends AnnotatedElement>
Predicate<T> withAnnotation(Class<? extends Annotation> annotation) where element is annotated with givenannotationstatic <T extends AnnotatedElement>
Predicate<T> withAnnotations(Annotation... annotations) where element is annotated with givenannotations, including member matchingstatic <T extends AnnotatedElement>
Predicate<T> withAnnotations(Class<? extends Annotation>... annotations) where element is annotated with givenannotationswithAnyParameterAnnotation(Annotation annotation) when method/constructor has any parameter with an annotation matches givenannotations, including member matchingwithAnyParameterAnnotation(Class<? extends Annotation> annotationClass) when method/constructor has any parameter with an annotation matches givenannotationswithClassModifier(int mod) when class modifier matches givenmodwithModifier(int mod) when member modifier matches givenmodwhere member name equals givennamestatic <T> Predicate<T> withNamePrefix(String prefix) where annotated element name startsWith givenprefixwithParameters(Class<?>... types) when method/constructor parameter types equals giventypeswithParametersAssignableFrom(Class... types) when method/constructor parameter types assignable from giventypeswithParametersAssignableTo(Class... types) when member parameter types assignable to giventypeswithParametersCount(int count) when method/constructor parameters count equal givencountstatic <T extends AnnotatedElement>
Predicate<T> withPattern(String regex) where member'stoStringmatches givenregexwithPrefix(String prefix) where member name startsWith givenprefixwhen member modifier is publicwithReturnType(Class<T> type) when method return type equal giventypewithReturnTypeAssignableFrom(Class<T> type) when method return type assignable from giventypewhen field type equal giventypewithTypeAssignableTo(Class<T> type) when field type assignable to giventype
-
Constructor Details
-
ReflectionUtilsPredicates
public ReflectionUtilsPredicates()
-
-
Method Details
-
withName
-
withPrefix
-
withNamePrefix
-
withPattern
where member'stoStringmatches givenregexget(Methods.of(someClass).filter(withPattern("public void .*"))) -
withAnnotation
public static <T extends AnnotatedElement> Predicate<T> withAnnotation(Class<? extends Annotation> annotation) where element is annotated with givenannotation -
withAnnotations
public static <T extends AnnotatedElement> Predicate<T> withAnnotations(Class<? extends Annotation>... annotations) where element is annotated with givenannotations -
withAnnotation
where element is annotated with givenannotation, including member matching -
withAnnotations
where element is annotated with givenannotations, including member matching -
withParameters
-
withParametersAssignableTo
-
withParametersAssignableFrom
-
withParametersCount
-
withAnyParameterAnnotation
public static Predicate<Member> withAnyParameterAnnotation(Class<? extends Annotation> annotationClass) when method/constructor has any parameter with an annotation matches givenannotations -
withAnyParameterAnnotation
when method/constructor has any parameter with an annotation matches givenannotations, including member matching -
withType
-
withTypeAssignableTo
-
withReturnType
-
withReturnTypeAssignableFrom
-
withModifier
-
withPublic
-
withStatic
-
withInterface
-
withClassModifier
-
isAssignable
-
toName
-
parameterTypes
-
parameterAnnotations
-
annotationTypes
-
annotationTypes
-
areAnnotationMembersMatching
-