|
Herve Boutemy made changes - 19/Dec/08 08:58 AM
Werner Guttmann made changes - 20/Dec/08 12:40 PM
Just looking at some of the Modello stuff you've referenced above, I wonder whether it would make more sense to provide you with additional hooks that do not rely on Strings, but on Field, Method, ..... ? Thanks for your help.
Here is a small patch showing the change done in Modello's javasource: I finally wrote it in JClass.
I suppose: Maven itself does not contain another javasource copy, Modello was written to do code generation for Maven's model
I need simple things that has a simple String as argument, since Modello user writes the code in a model.mdo XML file: I don't see how other things that Strings could be provided.
Herve Boutemy made changes - 20/Dec/08 04:01 PM
Herve Boutemy made changes - 22/Dec/08 04:43 PM
Herve, in your patch, you have added the new code to JClass whereas this issue's title talks about JAbstractClass. Is this change on intention ? In addition to adding new code to JClass.print(), our Velocity templates need to be changed as well. Just for reference, that would be a change to /castor2607/codegen/src/main/resources/org/exolab/castor/builder/printing/templates/main.vm et alias. Initial patch for review.
Werner Guttmann made changes - 30/Dec/08 02:16 PM
Yes, I initially thought JAbstractClass would be more general. But I didn't find what could be done somewhere else from JClass: then I chose to add the code only where useful.
Ok for me You are definitely right in that context. But with regards to code coherence, I decided to move things up the hierarchy, I will commit the code as is (most likely) , and deal with the Velocity changes through a sub-task or similar. Can I actually take it that you are not using the Velocity mode of the XML code generator ? Updatd patch, incl. changes to the existing Velocity templates.
Werner Guttmann made changes - 30/Dec/08 03:51 PM
exactly the latest patch is ok for me thank you
No, it does not, to my knowledge. But with release 1.3 we'll start deprecating the old code, as we'd like to achieve a few things: a) Not maintain two code bases for class generation from JClass instances. Given your 'sophisticated' usage of the XML code generator, I wonder whether you could briefly switch to the new Velocity mode and report back any findings you have.
great. I'll commit the patch later on today and deploy a (hopefully) last snapshot release of 1.3 within a day or so.
[
Permalink
]
Werner Guttmann made changes - 31/Dec/08 03:49 AM
Werner Guttmann made changes - 31/Dec/08 03:49 AM
Ralf Joachim made changes - 22/Jan/09 11:04 AM
Ralf Joachim made changes - 24/Jan/09 11:12 AM
Hi, I think we should add this to JStructure instead of JAbstractClass, Modello use it on a JInterface when it generate code. Hi, I have done a patch, which move sourcecode entries from AbstractJClass to JInterface, with it Modello "modello-plugin-java" work with Castor (because in modello we can add sourcecode to the interface too). The unit tests still works for Castor codegen component, and the unit test named org.codehaus.modello.plugin.java.javasource.JavaSourceTest in Modello succeed. More details regarding Modello are or will be on MODELLO-148 . The patch is here because i cannot attach a file nor reopen this issue (it also fix Index: src/main/java/org/exolab/javasource/AbstractJClass.java
/**
} + /** Ludovic, mind creating a completely new Jira issue and attach the patch to it. I will take care of this as soon as possible. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I don't see a reason why this should not be added. But let le ask you one question: if we add such a method to AbstractJClass, where in the generated source code should this arbitrary code fragment be added/inserted ? What does this method look like in your fork ?
PS Is this actually ''the'' fork many folks have mentioned to me over the past three years in terms of 'Maven forked Castor ...." ?