Details
-
Feature Request
-
Resolution: Done
-
Major
-
3.6.0.Final
-
None
Description
Both Java sequencers can add nodes for import statements. For the source file sequencer, nodes can be created for each physical import statement contained in the source file. For the class file sequencer, nodes for import statements can be derived by looking at the constants pool of the javaassist.bytecode.ClassFile.
It is worth noting that when an import statement with a wildcard is used, the import node(s) created by the two sequencers will be different. The source file sequencer will create one node for the wildcard import; while the class file sequencer will create a node for each referenced class within that imported package.
I've implemented the changes to both sequencers here:
https://github.com/elvisisking/modeshape/tree/java-imports
A couple more things:
- This new feature to the Java sequencers is needed by the dependency processing and de-sequencing features of Polyglotter, a data mapping project.
- In the referenced code branch above, I've created a mixin for a java package. I apply this mixin to each unstructured node created for a java package. This is also something Polyglotter needs.