Class MethodFinder.MethodFinderBase
java.lang.Object
nl.pim16aap2.util.reflection.ReflectionFinder<Method, MethodFinder.MethodFinderBase>
nl.pim16aap2.util.reflection.ReflectionFinder.ReflectionFinderWithParameters<Method, MethodFinder.MethodFinderBase>
nl.pim16aap2.util.reflection.MethodFinder.MethodFinderBase
- All Implemented Interfaces:
IAccessibleSetter<MethodFinder.MethodFinderBase>, IAnnotationFinder<MethodFinder.MethodFinderBase>
- Enclosing class:
MethodFinder
public abstract static class MethodFinder.MethodFinderBase
extends ReflectionFinder.ReflectionFinderWithParameters<Method, MethodFinder.MethodFinderBase>
implements IAccessibleSetter<MethodFinder.MethodFinderBase>, IAnnotationFinder<MethodFinder.MethodFinderBase>
Represents an implementation of
ReflectionFinder.ReflectionFinderWithParameters that can be used to find a method.-
Nested Class Summary
Nested classes/interfaces inherited from class ReflectionFinder
ReflectionFinder.ReflectionFinderWithParameters<T,U> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Class<? extends Annotation>[]protected booleanprotected booleanprotected booleanprotected final Class<?> Fields inherited from class ReflectionFinder.ReflectionFinderWithParameters
parametersFields inherited from class ReflectionFinder
modifiers -
Method Summary
Modifier and TypeMethodDescriptionUsed to configure the method finder to include thesourceclass's interfaces when searching for the target method.Used to configure the method finder to include thesourceclass's superclasses when searching for the target method.protected final StringgetNullErrorMessage(@Nullable String name, @Nullable Class<?> returnType) Used to configure the method finder to ignore thesourceclass's interfaces when searching for the target method.Used to configure the method finder to ignore thesourceclass's superclasses when searching for the target method.Sets the returned reflection object(s) as accessible.withAnnotations(Class<? extends Annotation>... annotations) Adds a requirement that the target constructor should contain at least a set of given annotations.Methods inherited from class ReflectionFinder.ReflectionFinderWithParameters
ignoreParameters, withoutParameters, withParameters, withParameters, withParametersMethods inherited from class ReflectionFinder
addModifiers, get, getNullable, withModifiers
-
Field Details
-
source
-
checkSuperClasses
protected boolean checkSuperClasses -
checkInterfaces
protected boolean checkInterfaces -
setAccessible
protected boolean setAccessible -
annotations
-
-
Method Details
-
withAnnotations
@SafeVarargs public final MethodFinder.MethodFinderBase withAnnotations(Class<? extends Annotation>... annotations) Description copied from interface:IAnnotationFinderAdds a requirement that the target constructor should contain at least a set of given annotations.- Specified by:
withAnnotationsin interfaceIAnnotationFinder<MethodFinder.MethodFinderBase>- Parameters:
annotations- The annotations the constructor should have.- Returns:
- The current object.
-
setAccessible
Description copied from interface:IAccessibleSetterSets the returned reflection object(s) as accessible.- Specified by:
setAccessiblein interfaceIAccessibleSetter<MethodFinder.MethodFinderBase>- Returns:
- The current object.
-
checkSuperClasses
Used to configure the method finder to include thesourceclass's superclasses when searching for the target method.Note that when both
checkSuperClassesandcheckInterfacesare enabled, the superclasses will take precedence. This means that all super classes (and their interfaces) are evaluated before the interfaces of the source class are evaluated.- Returns:
- The current method finder instance.
-
ignoreSuperClasses
Used to configure the method finder to ignore thesourceclass's superclasses when searching for the target method. This is the default behavior.- Returns:
- The current method finder instance.
-
checkInterfaces
Used to configure the method finder to include thesourceclass's interfaces when searching for the target method.Note that when both
checkSuperClassesandcheckInterfacesare enabled, the superclasses will take precedence. This means that all super classes (and their interfaces) are evaluated before the interfaces of the source class are evaluated.- Returns:
- The current method finder instance.
-
ignoreInterfaces
Used to configure the method finder to ignore thesourceclass's interfaces when searching for the target method. This is the default behavior.- Returns:
- The current method finder instance.
-
getNullErrorMessage
-