|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
---|---|
Inspector<T> | Provides an inspector for type T. |
PassBack | Provides services for PassBack objects. |
Class Summary | |
---|---|
AnnotationInspector | Provides an inspectors for annotations. |
ClassInspector | Provides an inspector for classes. |
ConstructorInspector | Provides services for . |
FieldInspector | Provides an inspector for fields. |
InspectorFactory | Provides a factory for inspectors. |
MethodInspector | Provides an inspector for methods. |
ParameterTypesInspector | Provides inspectors for parameter types. |
ReflectionInspectionHelpers | Provides helpers for reflection inspection. |
Enum Summary | |
---|---|
InspectorType | Specifies names for the different inspector types. |
Annotation Types Summary | |
---|---|
SampleAnnotation | Provides an example of an annotation for inspection by the
ReflectionInspector . |
Provides class inspection by reflection (subclass- and strategy pattern, resp).
The package
provides for class inspection by Java
reflection.
org.jsesoft.ri
ReflectionInspector
The class
traverses the reflection tree of the inspectee and calls handler function for all fields,
constructors, methods, and annotations found.
ReflectionInspector
The Reflection Inspector offers two methods of exploiting the information provided:
The JUnit test class org.jsesoft.ri.TestReflectionInspector
demonstrates both types of usage (below).
InspectStrategy
The interface
defines all the methods
the org.jsesoft.ri.InspectStrategy
ReflectionInspector
calls during traversal of the inspectee's reflection tree. There are three kinds
of such functions:
inspectXYZ()
functions called whenever the inspector detects an element XYZ in the reflection tree
(meant for doing the real work on the element). Implementations of these functions should return true
whenever they
completely processed an element, and false
if default processing should be accomplished.
preInspectXYZ()
functions called by the inspector before it handles the XYZ element
(meant for preprocessing the element)
postInspectXYZ()
functions called by the inspector after it handled the XYZ element
(meant for postprocessing the element)
InspectorSupport
class org.jsesoft.ri.InspectorSupport
provides
a default implementation for all the methods
the ReflectionInspector
calls during traversal of the inspectee's reflection tree. This default
implementation simply calls the respective function of the attached strategy. If no strategy is attached,
the default implementation returns immediately returning false
where a return value is required (meaning
that default processing should take place).
TestReflectionInspector
TestReflectionInspector
demonstrates both, using the InspectorSupport
class
testReflectionInspectorWithStrategy
)
testReflectionInspectorSuclassed
)
SampleAnnotation
This annotation provides an example of an annotation for inspection by the
ReflectionInspector
.
By the way, this annotation serves for full coverage of the unit test.
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |