Spring Bean support in PreEmptive Protection™ DashO™ for Android & Java is provided primarily by the Spring Bean special class.
It is configured with the class name (or name pattern) and optional entry points (e.g. init, destroy, and factory methods).
During processing, the property methods (
set*(*)), public constructors, and configured entry points, will be followed to determine unused methods.
The class, configured entry points, property methods and non-property methods can be configured to be renamed.
DashO will scan the Spring XML files during each build and will update any class references in the XML if DashO has renamed the corresponding Java class. It will update direct class references as well as class names listed in parameters or argument types. It will also update bean property names and entry point method names if DashO renamed them. Abstract beans (e.g. bean definitions without classes) will also have related property names and method names updated as it is assumed they are related to the renamed beans.
To get the most benefit out of DashO's Spring support, we suggest starting your project by using the New Project Wizard, and then making individual adjustments to the special classes as needed.
The New Project Wizard will identify Spring XML files, scan them for bean class references and configure Spring Bean special classes. When the New Project Wizard finds a bean definition in a Spring XML file, it:
Creates a new Spring Bean special class for the identified
Looks for configured
destroy-methodattributes in the XML and adds them to the special class as entry points. If no
destroy-methodattribute was found, it will check for
default-destroy-methodattributes, respectively, and instead adds them to the special class as entry points.
Looks for a configured
factory-methoddirectly on the bean and adds it to the special class as an entry point.
Looks for configured
replaced-methodelements and adds them to the special class as entry points.
Looks for constant values referenced using
util:constant static-fieldor the
Please take a look at the SpringBean sample project as it provides examples of DashO's support.
Note: If you use the
factory-beanattribute, you will need to manually add the corresponding
factory-methodas an entry point on the appropriate class.
If you use
replaced-methodfunctionality, you may need to specify the signature using the
arg-typeelements so the correct method will be identified after renaming.
If you use the
targetObjectattribute is not supported.