Package io.microsphere.reflect
Class ProxyUtils
- java.lang.Object
-
- io.microsphere.reflect.ProxyUtils
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isProxyable(java.lang.Class<?> type)
Determines whether the specified class is proxyable.
-
-
-
Method Detail
-
isProxyable
public static boolean isProxyable(java.lang.Class<?> type)
Determines whether the specified class is proxyable.A class is considered proxyable if:
- It has a non-private constructor with no parameters
- It is not declared final
- It does not have non-static, final methods with public, protected, or default visibility
- It is not a primitive type
- It is not an array type
Example Usage
public class ExampleClass { public void exampleMethod() {} } boolean result = ProxyUtils.isProxyable(ExampleClass.class); // result will be true as ExampleClass meets all proxyable conditions. public final class FinalClass { public void method() {} } result = ProxyUtils.isProxyable(FinalClass.class); // result will be false as FinalClass is declared final.
- Parameters:
type
- the class to check for proxyability- Returns:
true
if the class is proxyable, otherwisefalse
-
-