Package com.google.inject.matcher
Class Matchers
java.lang.Object
com.google.inject.matcher.Matchers
Matcher implementations. Supports matching classes and methods.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
private static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Matcher<AnnotatedElement>
annotatedWith
(Annotation annotation) Returns a matcher which matches elements (methods, classes, etc.) with a given annotation.static Matcher<AnnotatedElement>
annotatedWith
(Class<? extends Annotation> annotationType) Returns a matcher which matches elements (methods, classes, etc.) with a given annotation.any()
Returns a matcher which matches any input.private static void
checkForRuntimeRetention
(Class<? extends Annotation> annotationType) identicalTo
(Object value) Returns a matcher which matches only the given object.Returns a matcher which matches classes in the given package.inSubpackage
(String targetPackageName) Returns a matcher which matches classes in the given package and its subpackages.static <T> Matcher<T>
Inverts the given matcher.Returns a matcher which matches objects equal to the given object.Returns a matcher which matches methods with matching return types.subclassesOf
(Class<?> superclass) Returns a matcher which matches subclasses of the given type (as well as the given type).
-
Field Details
-
ANY
-
-
Constructor Details
-
Matchers
private Matchers()
-
-
Method Details
-
any
Returns a matcher which matches any input. -
not
Inverts the given matcher. -
checkForRuntimeRetention
-
annotatedWith
Returns a matcher which matches elements (methods, classes, etc.) with a given annotation. -
annotatedWith
Returns a matcher which matches elements (methods, classes, etc.) with a given annotation. -
subclassesOf
Returns a matcher which matches subclasses of the given type (as well as the given type). -
only
Returns a matcher which matches objects equal to the given object. -
identicalTo
Returns a matcher which matches only the given object. -
inPackage
Returns a matcher which matches classes in the given package. Packages are specific to their classloader, so classes with the same package name may not have the same package at runtime. -
inSubpackage
Returns a matcher which matches classes in the given package and its subpackages. UnlikeinPackage()
, this matches classes from any classloader.- Since:
- 2.0
-
returns
Returns a matcher which matches methods with matching return types.
-