Package org.proxy4j.core.reflect
Class InheritableMethodExtractor
- java.lang.Object
-
- org.proxy4j.core.reflect.BaseMethodExtractor
-
- org.proxy4j.core.reflect.UnitypeMethodExtractor
-
- org.proxy4j.core.reflect.InheritableMethodExtractor
-
- All Implemented Interfaces:
MethodExtractor
public class InheritableMethodExtractor extends UnitypeMethodExtractor
A two-level
MethodExtractorwhere the super type acts as an additional source of information, e.g. accessing annotations inmethod filters.- Author:
- Brennan Spies
-
-
Constructor Summary
Constructors Constructor Description InheritableMethodExtractor(Class<T> owningType, Class<? super T> superType)Creates aMethodExtractorwith a super type that acts as an additional source of information forMethodFilters, e.g.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<Method>getMethods(MethodFilter filter)Returns accessible methods that pass the given filter.Collection<Method>getProxyableMethods()Returns all methods that can be proxied.Collection<Method>getPublicMethods()Returns allpublicmethods that are proxyable.protected booleanisObjectMethod(Method method)True if the method is declared byjava.lang.Object.protected booleanisProxyable(Method method)Determines if the given method is proxyable.-
Methods inherited from class org.proxy4j.core.reflect.UnitypeMethodExtractor
getOwningPackageName, getOwningType
-
Methods inherited from class org.proxy4j.core.reflect.BaseMethodExtractor
getPackageName, isIncludeObjectMethods, setIncludeObjectMethods
-
-
-
-
Constructor Detail
-
InheritableMethodExtractor
public InheritableMethodExtractor(Class<T> owningType, Class<? super T> superType)
Creates aMethodExtractorwith a super type that acts as an additional source of information forMethodFilters, e.g. in exposing annotations. In most cases, the super type will be an interface.- Type Parameters:
T- TheTypeof the method class- Parameters:
owningType- The method type to be proxiedsuperType- Any super type of the method type
-
-
Method Detail
-
getProxyableMethods
public Collection<Method> getProxyableMethods()
Returns all methods that can be proxied. This excludes methods that areprivate,static, orfinal.- Returns:
- All methods that can be proxied
-
getPublicMethods
public Collection<Method> getPublicMethods()
Returns allpublicmethods that are proxyable.- Returns:
- All public methods
-
getMethods
public Collection<Method> getMethods(MethodFilter filter)
Returns accessible methods that pass the given filter.- Parameters:
filter- The method filter- Returns:
- The filtered methods
-
isObjectMethod
protected boolean isObjectMethod(Method method)
True if the method is declared byjava.lang.Object.- Overrides:
isObjectMethodin classUnitypeMethodExtractor- Parameters:
method- The method- Returns:
- True if this method is declared by
Object
-
isProxyable
protected boolean isProxyable(Method method)
Determines if the given method is proxyable.- Overrides:
isProxyablein classUnitypeMethodExtractor- Parameters:
method- The method to test- Returns:
- True if method is proxyable
-
-