Package rife.instrument
Class ClassInterfaceDetector
java.lang.Object
rife.instrument.ClassInterfaceDetector
- Direct Known Subclasses:
ContinuableDetector
Detects whether a class implements a particular interface by analyzing the
bytecode instead of loading the class and performing reflection calls.
- Since:
- 1.0
-
Constructor Summary
ConstructorDescriptionClassInterfaceDetector
(ClassBytesProvider bytesProvider, String internalInterfaceNameInterned) Creates a new instance of the interface detector. -
Method Summary
Modifier and TypeMethodDescriptionboolean
detect
(byte[] bytes, boolean doAutoReload) Perform the detection.
-
Constructor Details
-
ClassInterfaceDetector
public ClassInterfaceDetector(ClassBytesProvider bytesProvider, String internalInterfaceNameInterned) Creates a new instance of the interface detector.- Parameters:
bytesProvider
- the bytecode provider that will be used to load the bytes of the parent classes or interfacesinternalInterfaceNameInterned
- the name of the interface that should be detected, it should be in the internal bytecode naming format (/ instead of .) and it should be interned.- Since:
- 1.0
-
-
Method Details
-
detect
Perform the detection.- Parameters:
bytes
- the bytecode of the class that is being analyzeddoAutoReload
- indicator if the class should be automatically reloaded after a modification to the sources, in case theClassBytesProvider
supports this- Returns:
true
if the detection was successful; orfalse
otherwise- Throws:
ClassNotFoundException
-