Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have never extended the Axis2 WSDL2Java emitter so I don't know how much flexibility you would gain from doing so. The article you reference suggests that you can hook into the generation process quite easily. It really depends on what you have to generate. Recently I had to do create boilerplate code from Database schemas and WSDLs and I have used a mixed approach:</p> <ul> <li>Groovy</li> </ul> <p>Groovy is great for rapid prototyping and templates. You can, for instance, collect information from a Database or a Wsdl and emit code based on a template. Here you can see some examples: <a href="http://groovy.codehaus.org/Groovy+Templates" rel="nofollow">http://groovy.codehaus.org/Groovy+Templates</a></p> <ul> <li>PMD API</li> </ul> <p><a href="http://pmd.sourceforge.net/" rel="nofollow">PMD</a> is a tool to scan Java code and report potential problems. It also exposes an API for parsing code using XPATH and has a very rich model to work with. You can do stuff like:</p> <pre><code>final Java15Parser parser = new Java15Parser(); final FileInputStream stream = new FileInputStream("VehicleServiceType.java"); final Object c = parser.parse(new InputStreamReader(stream)); final XPath xpath = new BaseXPath("//TypeDeclaration/Annotation/NormalAnnotation[Name/@Image = 'WebService']", new DocumentNavigator()); for (final Iterator iter = xpath.selectNodes(c).iterator(); iter.hasNext();) { final Object obj = iter.next(); // Do code generation based on annotations... } </code></pre> <p>Personally, I have found that a mixed approach works better then a monolithic one. Code generation is often an art more then a science. One more thing: in my current project, I'm looking at Python for (simple) code generation. It has a very nice templating library (<a href="http://jinja.pocoo.org/" rel="nofollow">jinja</a>), but I wouldn't recommend it for parsing Java code.</p> <p>Hope this help!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload