<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-28887898</id><updated>2011-07-30T20:38:38.437-07:00</updated><category term='juneloop'/><category term='jnlp'/><category term='jaxb jpa jpa2 hyperjaxb hyperjaxb3 hj3'/><category term='maven-jaxb2-plugin'/><category term='jaxb javascript ecmascript codemodel xml programmatic'/><category term='jaxb'/><category term='dtd'/><category term='open-source'/><category term='programmatic'/><title type='text'>Assisting sunsets</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-28887898.post-4866945170725534005</id><published>2011-07-10T03:26:00.001-07:00</published><updated>2011-07-10T03:30:29.167-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jaxb jpa jpa2 hyperjaxb hyperjaxb3 hj3'/><title type='text'>Hyperjaxb3 0.5.6 is released</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "&gt;I am very glad to announce the &lt;a href="http://confluence.highsource.org/display/HJ3/Release+0.5.6"&gt;0.5.6 release&lt;/a&gt; of &lt;a href="http://confluence.highsource.org/display/HJ3/Home"&gt;Hyperjaxb3&lt;/a&gt;.&lt;br /&gt;This release features two major highlights:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://confluence.highsource.org/display/HJ3/JPA+2+Support"&gt;JPA 2 support&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://confluence.highsource.org/display/HJ3/Maven+Repository"&gt;Distribution via central Maven repository&lt;/a&gt; (see )&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;It also fixes a great number of issues, please see release notes &lt;a href="http://java.net/jira/secure/ReleaseNote.jspa?projectId=10127&amp;amp;version=14762"&gt;here&lt;/a&gt; and &lt;a href="http://jira.highsource.org/secure/ReleaseNote.jspa?version=10073&amp;amp;styleName=Html&amp;amp;projectId=10000"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-4866945170725534005?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/4866945170725534005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=4866945170725534005' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/4866945170725534005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/4866945170725534005'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2011/07/hyperjaxb3-056-is-released.html' title='Hyperjaxb3 0.5.6 is released'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-7787098029227083273</id><published>2011-04-28T23:15:00.000-07:00</published><updated>2011-04-28T23:16:23.984-07:00</updated><title type='text'>Jsonix 1.0 is released</title><content type='html'>&lt;p&gt;I am glad to announce the first release of, Jsonix.&lt;/p&gt;  &lt;p&gt;Jsonix (JSON interfaces for XML) is a JavaScript library which allows  you to convert between XML and JSON structures. Jsonix is essentially a  JavaScript analog of &lt;a href="http://jaxb.java.net/"&gt;JAXB&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;With Jsonix you can parse XML into JSON (this process is called  unmarshalling) or serialize JSON in XML form (this is called  marshalling).&lt;/p&gt;  &lt;p&gt;These conversions are based on simple XML/JSON mappings which can be written manually or generated from an XML Schema.&lt;/p&gt;  &lt;p&gt;Project website:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;a href="http://confluence.highsource.org/display/JSNX/Jsonix"&gt;http://confluence.highsource.org/display/JSNX/Jsonix&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;   &lt;p&gt;Downloads:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;a href="http://confluence.highsource.org/display/JSNX/Downloads"&gt;http://confluence.highsource.org/display/JSNX/Downloads&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;   &lt;p&gt;Download features:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;Scripts&lt;/li&gt;&lt;li&gt;Schema compiler&lt;/li&gt;&lt;li&gt;Sample projects (batch/command line, Ant, Maven)&lt;/li&gt;&lt;li&gt;Demo projects&lt;/li&gt;&lt;/ul&gt;   &lt;p&gt;User guide:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;a href="http://confluence.highsource.org/display/JSNX/User+Guide"&gt;http://confluence.highsource.org/display/JSNX/User+Guide&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;   &lt;p&gt;Mailing lists:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;a href="http://confluence.highsource.org/display/JSNX/Mailing+lists"&gt;http://confluence.highsource.org/display/JSNX/Mailing+lists&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-7787098029227083273?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/7787098029227083273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=7787098029227083273' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/7787098029227083273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/7787098029227083273'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2011/04/jsonix-10-is-released.html' title='Jsonix 1.0 is released'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-7537718628496024458</id><published>2010-10-27T02:39:00.000-07:00</published><updated>2010-10-27T03:52:50.817-07:00</updated><title type='text'>Jsonix - JAXB for JavaScript</title><content type='html'>Folowing up on the ideas from my previous posts, I've started the project called Jsonix (JSON interfaces for XML):&lt;br /&gt;&lt;br /&gt;&lt;a href="http://confluence.highsource.org/display/MISC/Jsonix"&gt;http://confluence.highsource.org/display/MISC/Jsonix&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Jsonix is basically a JAXB analog for JavaScript.  With Jsonix you can:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;parse XML into JSON;&lt;/li&gt;&lt;li&gt;serialize JSON into XML;&lt;/li&gt;&lt;li&gt;define XML/JSON mappings declaratively;&lt;/li&gt;&lt;li&gt;generate Jsonix mappings from XML Schemas.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Here's a small example of how a JSON purchase order could be marshalled in XML:&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;pre&gt;&lt;br /&gt;var context = Jsonix.Context.newInstance([ PO ]);&lt;br /&gt;// Marshal JSON as XML (DOM node)&lt;br /&gt;var unmarshaller = context.createUnmarshaller();&lt;br /&gt;&lt;br /&gt;var node = marshaller.marshal({&lt;br /&gt;name: {localPart: "purchaseOrder"},&lt;br /&gt;value: {&lt;br /&gt; shipTo: {&lt;br /&gt;  name: "Alice Smith",&lt;br /&gt;  street: "123 Maple Street",&lt;br /&gt;  city: "Mill Valley",&lt;br /&gt;  state: "CA",&lt;br /&gt;  zip: 90952  &lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;});&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This will produce an XML like:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;purchaseOrder orderDate="1999-10-20"&gt;&lt;br /&gt;&amp;lt;shipTo country="US"&gt;&lt;br /&gt;  &amp;lt;name&gt;Alice Smith&amp;lt;/name&gt;&lt;br /&gt;  &amp;lt;street&gt;123 Maple Street&amp;lt;/street&gt;&lt;br /&gt;  &amp;lt;city&gt;Mill Valley&amp;lt;/city&gt;&lt;br /&gt;  &amp;lt;state&gt;CA&amp;lt;/state&gt;&lt;br /&gt;  &amp;lt;zip&gt;90952&amp;lt;/zip&gt;&lt;br /&gt;&amp;lt;/shipTo&gt;&lt;br /&gt;&amp;lt;!-- ... --&gt;&lt;br /&gt;&amp;lt;/purchaseOrder&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And here's how you'd unmarshal:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;// Unmarshal JSON from XML (retrieved from an URL)&lt;br /&gt;var unmarshaller = context.createUnmarshaller();&lt;br /&gt;unmarshaller.unmarshal({&lt;br /&gt;url : "po.xml",&lt;br /&gt;success : function(po) {&lt;br /&gt; assertEquals("purchaseOrder", po.name.localPart);&lt;br /&gt; assertEquals("Alice Smith", po.value.shipTo.name);&lt;br /&gt;}&lt;br /&gt;});&lt;/code&gt;&lt;span style="font-family:Georgia,serif;"&gt;&lt;br /&gt;&lt;br /&gt;The project is in development, I'll be working on it next weeks.&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-7537718628496024458?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/7537718628496024458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=7537718628496024458' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/7537718628496024458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/7537718628496024458'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2010/10/jsonix-jaxb-for-javascript.html' title='Jsonix - JAXB for JavaScript'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-9191635603512733662</id><published>2010-10-16T01:34:00.000-07:00</published><updated>2010-10-16T01:54:46.125-07:00</updated><title type='text'>Generating JavaScript Code with JavaScript Code Model</title><content type='html'>&lt;a href="http://confluence.highsource.org/display/MISC/JavaScript+Code+Model"&gt;JavaScript Code Model&lt;/a&gt; (JSCM for short) is a Java library which precisely models JavaScript grammar as defined in &lt;a href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf"&gt;ECMAScript specification&lt;/a&gt;. JSCM allows you to programmatically create, analyze and manipulate JavaScript code.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This post demonstrates usage of JSCM to generate JavaScript code from a Java program.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here's a code snippet which creates a factorial function:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;// Instantiate the code model&lt;br /&gt;JSCodeModel codeModel = new CodeModelImpl();&lt;br /&gt;// Create the program&lt;br /&gt;JSProgram program = codeModel.program();&lt;br /&gt;// Add a function declaration&lt;br /&gt;JSFunctionDeclaration factorial = program&lt;br /&gt; .functionDeclaration("factorial");&lt;br /&gt;// Add a function parameter&lt;br /&gt;JSVariable x = factorial.parameter("x");&lt;br /&gt;// Create an integer literal&lt;br /&gt;JSDecimalIntegerLiteral one = codeModel.integer(1);&lt;br /&gt;// Add a return statement to the function body&lt;br /&gt;factorial.getBody()._return(&lt;br /&gt; x.le(one).cond(&lt;br /&gt;  one,&lt;br /&gt;  x.mul(factorial.getFunctionExpression().i()&lt;br /&gt;   .args(x.minus(one)))));&lt;br /&gt;&lt;br /&gt;// Write the program code to the System.out&lt;br /&gt;new CodeWriter(System.out).program(program);&lt;/code&gt;&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;This produces the following JavaScript code:&lt;div&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;function factorial(x) {&lt;br /&gt; return x &lt;= 1 ? 1 : x * factorial(x - 1); }&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In this example we &lt;i&gt;first&lt;/i&gt; produce the code model by creating expressions, statements, function declarations and so on and &lt;i&gt;then&lt;/i&gt; use code writer to serialize the created program into the &lt;code&gt;System.out&lt;/code&gt;.  This process almost guarantees that the resulting code is syntactically and grammatically correct - and well-formatted as well. And I hope the API is very convenient - especially if you compare it to the "good old" string concatenation.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the future I'll also provide a parser which parses JavaScript code and builds its model. It will then be possible to analyze existing JavaScript code and manipulate it - for instance add profiling statements, reformat, restructure, refactor, optimize or obfuscate.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-9191635603512733662?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/9191635603512733662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=9191635603512733662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/9191635603512733662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/9191635603512733662'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2010/10/generating-javascript-code-with.html' title='Generating JavaScript Code with JavaScript Code Model'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-7407370018345000829</id><published>2010-10-16T01:17:00.000-07:00</published><updated>2010-10-16T01:33:58.963-07:00</updated><title type='text'>JavaScript Code Model 1.0 released</title><content type='html'>&lt;div&gt;Last few weeks I've been working on the JavaScript code model, the idea I describe in my &lt;a href="http://lexicore.blogspot.com/2010/09/javascript-code-model.html"&gt;previous post&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now it is ready and released. Here's the &lt;a href="http://confluence.highsource.org/display/MISC/JavaScript+Code+Model"&gt;project page&lt;/a&gt; in &lt;a href="http://confluence.highsource.org/"&gt;my Confluence&lt;/a&gt; and a &lt;a href="http://static.highsource.org/jscm"&gt;generated Maven Site&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now I can go on with my idea of &lt;a href="http://stackoverflow.com/questions/3819192/is-there-a-javascript-api-for-xml-binding-analog-to-jaxb-for-java"&gt;JAXB analog for JavaScript&lt;/a&gt;. My plans are:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Write a JAXB plugin which would generate XML bindings for JavaScript objects in form of JSON. This is analogous to JAXB annotations.&lt;/li&gt;&lt;li&gt;Write JavaScript runtime to parse (unmarshal) JSON objects from XML or serialize (marshal) these objects back to XML. This is analogous to &lt;span class="Apple-style-span" &gt;JAXBContext&lt;/span&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;In the next post I'll give an example of how &lt;a href="http://confluence.highsource.org/display/MISC/JavaScript+Code+Model"&gt;JSCM&lt;/a&gt; can be used to generate JavaScript code.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-7407370018345000829?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/7407370018345000829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=7407370018345000829' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/7407370018345000829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/7407370018345000829'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2010/10/javascript-code-model-10-released.html' title='JavaScript Code Model 1.0 released'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-1287915976772088988</id><published>2010-09-29T15:37:00.000-07:00</published><updated>2010-09-30T01:44:07.494-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jaxb javascript ecmascript codemodel xml programmatic'/><title type='text'>JavaScript Code Model</title><content type='html'>&lt;div&gt;&lt;a href="http://stackoverflow.com/questions/3819192/is-there-a-javascript-api-for-xml-binding-analog-to-jaxb-for-java"&gt;I was recently looking for a JAXB-like API for JavaScript&lt;/a&gt; which would allow converting between XML and JavaScript objects on the client. Such tool would be extremely useful when working with schema-based XML documents in JavaScript clients.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Apparently, there's no such thing.  So I've started thinking about writing one. To put it frankly, the idea fascinated me so much that I simply could not help starting experimenting.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Today I've started with a code model for JavaScript. I'm writing an API which would allow generating syntactically correct JavaScript from Java. This will be somewhat similar to the &lt;a href="https://codemodel.dev.java.net/"&gt;code model library&lt;/a&gt; used in JAXB/XJC, only implemented for JavaScript. I took the &lt;a href="http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf"&gt;ECMAScript specification&lt;/a&gt; and a couple of &lt;a href="http://www.antlr.org/grammar/1153976512034/ecmascriptA3.g"&gt;grammars&lt;/a&gt; and wrote over 50 interfaces which model the grammar of the JavaScript code. Here's a couple of examples of what I got so far:&lt;/div&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;pre&gt;JSProgram program = codeModel.program();&lt;br /&gt;&lt;br /&gt;JSNumericLiteral one = codeModel.lit(1);&lt;br /&gt;JSFunctionDeclaration factorial =&lt;br /&gt; program.declare("factorial");&lt;br /&gt;JSVariable x = factorial.parameter("x");&lt;br /&gt;factorial.body()._return(&lt;br /&gt; x.le(one).cond(one,&lt;br /&gt;   x.mul(codeModel.call(factorial).args(x.minus(one)))));&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This should produce the code of the factorial function like:&lt;div&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;pre&gt;function factorial(x)&lt;br /&gt;{ return x &lt;= 1 ? 1 : x * factorial(x - 1); }&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;The conditional could be rolled out into an if statement:&lt;/div&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;pre&gt;JSIfStatement _if = factorial.body()._if(x.le(one));&lt;br /&gt;_if._then()._return(one);&lt;br /&gt;_if._else()._return(&lt;br /&gt; x.mul(codeModel.call(factorial).args(x.minus(one))));&lt;/pre&gt;&lt;br /&gt;I need this to be able to generate XML-JSON mappings in correct JavaScript syntax. String concatenation just does not feel right.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But what's probably the most important is that it's great fun to work on this. :)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-1287915976772088988?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/1287915976772088988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=1287915976772088988' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/1287915976772088988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/1287915976772088988'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2010/09/javascript-code-model.html' title='JavaScript Code Model'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-160263910621343311</id><published>2010-09-26T04:53:00.000-07:00</published><updated>2010-09-26T05:24:23.272-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jnlp'/><category scheme='http://www.blogger.com/atom/ns#' term='open-source'/><category scheme='http://www.blogger.com/atom/ns#' term='programmatic'/><category scheme='http://www.blogger.com/atom/ns#' term='dtd'/><category scheme='http://www.blogger.com/atom/ns#' term='maven-jaxb2-plugin'/><category scheme='http://www.blogger.com/atom/ns#' term='jaxb'/><category scheme='http://www.blogger.com/atom/ns#' term='juneloop'/><title type='text'>Juneloop - tool for programmatic manipulation of JNLP files</title><content type='html'>We recently needed to create a JNLP file for &lt;a href="http://en.wikipedia.org/wiki/Java_Web_Start"&gt;Java Web Start&lt;/a&gt; programmatically from a template. Basically we needed to add a &lt;code&gt;property&lt;/code&gt; element to an existing JNLP file. There were also similar requirements from a project partner, so all in all it goes into a direction of programmatic manipulation of JNLP files.&lt;br /&gt;&lt;br /&gt;Since JNLP is defined in DTDs (&lt;a href="http://java.sun.com/dtd/JNLP-1.5.dtd"&gt;1.5&lt;/a&gt;, &lt;a href="http://java.sun.com/dtd/JNLP-6.0.dtd"&gt;6.0&lt;/a&gt;) I though this would be a good JAXB project (and a good demo case for &lt;a href="http://confluence.highsource.org/display/MJIIP/Maven+JAXB2+Plugin"&gt;Maven JAXB2 Plugin&lt;/a&gt;). All I needed to do is compile JNLP DTDs with XJC, add a couple of tests and here you go:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://confluence.highsource.org/display/MISC/Juneloop"&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Juneloop&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;, a tool for programmatic manipulation of JNLP files.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;With Juneloop you can:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;unmarshal JNLP resources;&lt;/li&gt;&lt;li&gt;create or modify JNLP object structures programmatically;&lt;/li&gt;&lt;li&gt;marshal JNLP object structures.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;See Juneloop documentation here:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://confluence.highsource.org/display/MISC/Juneloop"&gt;http://confluence.highsource.org/display/MISC/Juneloop&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Juneloop is hosted on Sourceforge:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="https://sourceforge.net/projects/juneloop/"&gt;https://sourceforge.net/projects/juneloop/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-160263910621343311?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/160263910621343311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=160263910621343311' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/160263910621343311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/160263910621343311'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2010/09/juneloop-tools-for-programmatic.html' title='Juneloop - tool for programmatic manipulation of JNLP files'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-7142087471903955403</id><published>2010-09-26T04:34:00.000-07:00</published><updated>2010-09-26T04:48:11.382-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='open-source'/><title type='text'>Long Time No See</title><content type='html'>It was quite a while that I posted last time to this blog. In this time I did a huge amount of work on my open-source projects (visit &lt;a href="http://confluence.highsource.org/dashboard.action"&gt;confluence.highsource.org&lt;/a&gt; and see for yourself).&lt;br /&gt;&lt;br /&gt;Now I've decided to come back to this blog and to use it to post announcements and updates about my OSS activities. New projects, new releases, new initiatives.&lt;br /&gt;&lt;br /&gt;I'm certainly not hoping for a huge audience (I'm bad in marketing anyway), I just need an instrument which would help me to keep track of my developments. An maybe this will help you to find one or another useful tool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-7142087471903955403?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/7142087471903955403/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=7142087471903955403' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/7142087471903955403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/7142087471903955403'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2010/09/long-time-no-see.html' title='Long Time No See'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-6995345359860413571</id><published>2008-07-28T23:02:00.000-07:00</published><updated>2008-07-28T23:23:10.039-07:00</updated><title type='text'>Hyperjaxb3 0.4 to be released pretty soon</title><content type='html'>Hi everyone,&lt;br /&gt;&lt;br /&gt;I'm writing now just to inform you guys on the process.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Last few month I was intensively working on Hyperjaxb3 version 0.4 and now it's ready. This version has gone through a large refactoring. I'll post the details in the release description but here's a couple of hightlights:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Previously HJ3 could only generate JPA annotations. The 0.4 version can also generate ORM mappings as XML resources (in &lt;a href="http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"&gt;this&lt;/a&gt; schema).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;New version introduced global customizations. Now you can customize generated mappings globally. For instance, you can instruct Hyperjaxb3 to map complex collections as &lt;code&gt;many-to-many&lt;/code&gt; (instead of default &lt;code&gt;one-to-many&lt;/code&gt;), choose between &lt;code&gt;join-column&lt;/code&gt; or &lt;code&gt;join-table&lt;/code&gt; association strategies per default and many other things.&lt;br /&gt;&lt;li&gt;I've added more tests, more sample and template projects to help people start with HJ3 more easily.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;As I said, HJ3 version 0.4 is ready and you can get it from the &lt;a href="http://download.java.net/maven/2/org/jvnet/hyperjaxb3/"&gt;dev.java.net Maven2 repository&lt;/a&gt;. Next days I'll be working on documentation and release description, so it's not an "official" release yet. Stay tuned.&lt;br /&gt;&lt;br /&gt;ps. Along with HJ3 version 0.4 there's also new versions of &lt;a href="https://maven2-repository.dev.java.net/svn/maven2-repository/trunk/www/repository/org/jvnet/annox/"&gt;Annox&lt;/a&gt; and &lt;a href="http://download.java.net/maven/2/org/jvnet/jaxb2_commons/"&gt;Jaxb2-commons&lt;/a&gt; available.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-6995345359860413571?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/6995345359860413571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=6995345359860413571' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/6995345359860413571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/6995345359860413571'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2008/07/hyperjaxb3-04-to-be-released-pretty.html' title='Hyperjaxb3 0.4 to be released pretty soon'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-6067054268868354976</id><published>2007-12-21T00:49:00.000-08:00</published><updated>2007-12-21T02:04:48.255-08:00</updated><title type='text'>Hyperjaxb3 Release 0.3</title><content type='html'>I'm currently preparing the 0.3 release of &lt;a href="https://hyperjaxb3.dev.java.net"&gt;Hyperjaxb3&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In the 0.3 version I worked mostly to extends the set of supported schemata. I'm really grateful to all the people who sent me their schemata. This helped to find out which cases are practically important so I could concentrate on real-world scenarios. As a result, the set of schemas supported by &lt;a href="https://hyperjaxb3.dev.java.net"&gt;Hyperjaxb3&lt;/a&gt; is becoming very large. Below are just some examples of schemata from the test cases (which includes more that four dozen schemas):&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://bibtexml.sourceforge.net/"&gt;BibTeXML&lt;/a&gt; - bibliography XML schema&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://ebxmlrr.sourceforge.net/"&gt;ebXMLRR&lt;/a&gt; - ebXML Registry Reference&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.imsglobal.org/ep/index.html"&gt;IMS ePortfolio and LIP&lt;/a&gt; - eLearning&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.iodalliance.com/"&gt;IODA&lt;/a&gt; - digital music distribution&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.newsml.org/"&gt;NewsML&lt;/a&gt; and &lt;a href="http://www.sportsml.org/"&gt;SportsML&lt;/a&gt; - news and sports news markup languages&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.plm.automation.siemens.com/en_us/products/open/"&gt;PLM XML&lt;/a&gt;- manufacturing components&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://sbml.org/index.psp"&gt;SBML&lt;/a&gt; - Systems Biology Markup Language&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.ecb.int/paym/sepa/html/links.en.html"&gt;SEPA&lt;/a&gt; - financial exchange in Single Euro Payment Area&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.oasis-open.org/committees/xacml/"&gt;XACML&lt;/a&gt; - eXtensible Access Control Markup Language&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;These are just &lt;i&gt;some examples&lt;/i&gt; of the schemata &lt;a href="https://hyperjaxb3.dev.java.net"&gt;Hyperjaxb3&lt;/a&gt; currently support. I'll be working to extend the supported set to 100% (literally any schema) in the 0.4 version. It's just few cases left.&lt;br /&gt;&lt;br /&gt;In this release I've also updated the versions of maven-jaxb2-plugin (0.5) and JAXB (2.1.6) to take advantage of the latest developments in these projects.&lt;br /&gt;&lt;br /&gt;Please visit the &lt;a href="http://wiki.glassfish.java.net/Wiki.jsp?page=Hyperjaxb3Release0.3"&gt;release announcement page&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Here's a couple of examples for &lt;a href="http://download.java.net/maven/2/org/jvnet/hyperjaxb3/hyperjaxb3-ejb-samples-po-initial/0.3/hyperjaxb3-ejb-samples-po-initial-0.3-maven-src.zip"&gt;Maven&lt;/a&gt; and &lt;a href="http://download.java.net/maven/2/org/jvnet/hyperjaxb3/hyperjaxb3-ejb-samples-po-initial/0.3/hyperjaxb3-ejb-samples-po-initial-0.3-ant-src.zip"&gt;Ant&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-6067054268868354976?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/6067054268868354976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=6067054268868354976' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/6067054268868354976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/6067054268868354976'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2007/12/hyperjaxb3-release-03.html' title='Hyperjaxb3 Release 0.3'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-6934589261308777373</id><published>2007-09-20T01:12:00.000-07:00</published><updated>2007-09-20T01:44:47.454-07:00</updated><title type='text'>Hyperjaxb3 Release 0.2</title><content type='html'>Yesterday I've &lt;a href="http://wiki.glassfish.java.net/Wiki.jsp?page=Hyperjaxb3Release0.2"&gt;released Hyperjaxb3 version 0.2&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It was a very long way, but finally we've managed to produce a version which can be presented to the public.&lt;br /&gt;&lt;br /&gt;I've managed to overcome most of the JPA limitations (take a look at the &lt;a href="http://wiki.glassfish.java.net/Wiki.jsp?page=Hyperjaxb3Reference"&gt;reference&lt;/a&gt;, I describe those in quite a detail) and make Hyperjaxb3 support a really large set of schemas.&lt;br /&gt;&lt;br /&gt;The project is very well tested. By testing I mean real integration testing with roundtrips. It's not about that schemas are just compiled or something. I do test that sample XML data survives unmarshalling-storing-loading-marshalling without loss.&lt;br /&gt;&lt;br /&gt;Hyperjaxb3 is (well, relatively) &lt;a href="http://wiki.glassfish.java.net/Wiki.jsp?page=Hyperjaxb3Reference"&gt;well-documented&lt;/a&gt;. We also provide sample projects for &lt;a href="http://download.java.net/maven/2/org/jvnet/hyperjaxb3/hyperjaxb3-ejb-samples-po-initial/0.2.GA/hyperjaxb3-ejb-samples-po-initial-0.2.GA-maven-src.zip"&gt;Ant&lt;/a&gt; and &lt;a href="http://download.java.net/maven/2/org/jvnet/hyperjaxb3/hyperjaxb3-ejb-samples-po-initial/0.2.GA/hyperjaxb3-ejb-samples-po-initial-0.2.GA-ant-src.zip"&gt;Maven&lt;/a&gt; so I hope you can get started really quickly.&lt;br /&gt;&lt;br /&gt;I was yesterday asked if the project is production-ready. My answer is &lt;span style="font-weight:bold;"&gt;yes&lt;/span&gt;. Runtime code is minimal and quite stable. Correctness of the generated annotations is checked by numerous tests. Documentation and sample projects available. Therefore I can answer - yes, it is ready for production.&lt;br /&gt;&lt;br /&gt;Still, it's 0.2. I'll work to support more schemas, more customizations and tuning options.&lt;br /&gt;I also plan to support vendor-specific extensions. However these modules may be released as a commercial product (I'm not sure yet).&lt;br /&gt;&lt;br /&gt;So you are welcome. :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-6934589261308777373?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/6934589261308777373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=6934589261308777373' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/6934589261308777373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/6934589261308777373'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2007/09/hyperjaxb3-release-02.html' title='Hyperjaxb3 Release 0.2'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-117559052135264486</id><published>2007-04-03T01:46:00.000-07:00</published><updated>2007-04-03T01:55:21.363-07:00</updated><title type='text'>Hyperjaxb2 0.6.2 released</title><content type='html'>I've not posted to this blog for a while.&lt;br /&gt;&lt;br /&gt;The work on Hyperjaxb2 goes just fine. I've released the 0.6.2 version last week.&lt;br /&gt;Here are the download links:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt; Distribution &lt;a href="/files/documents/3564/53720/hyperjaxb2-0.6.2-minimal.zip"&gt;Minimal&lt;/a&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt; Basic Template &lt;a href="/files/documents/3564/53728/hyperjaxb2-template-basic-0.6.2-ant-src.zip"&gt;Ant&lt;/a&gt;|&lt;a href="/files/documents/3564/53724/hyperjaxb2-template-basic-0.6.2-maven-src.zip"&gt;Maven&lt;/a&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt; Nokis Sample &lt;a href="/files/documents/3564/53725/hyperjaxb2-sample-nokis-0.6.2-ant-src.zip"&gt;Ant&lt;/a&gt;|&lt;a href="/files/documents/3564/53721/hyperjaxb2-sample-nokis-0.6.2-maven-src.zip"&gt;Maven&lt;/a&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt; PO Initial Sample &lt;a href="/files/documents/3564/53727/hyperjaxb2-sample-po-initial-0.6.2-ant-src.zip"&gt;Ant&lt;/a&gt;|&lt;a href="/files/documents/3564/53723/hyperjaxb2-sample-po-initial-0.6.2-maven-src.zip"&gt;Maven&lt;/a&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt; PO Final Sample &lt;a href="/files/documents/3564/53726/hyperjaxb2-sample-po-final-0.6.2-ant-src.zip"&gt;Ant&lt;/a&gt;|&lt;a href="/files/documents/3564/53722/hyperjaxb2-sample-po-final-0.6.2-maven-src.zip"&gt;Maven&lt;/a&gt; &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Currently I'm working towards the 0.7.0 release which will also include an example of a web service sample application on Spring/Spring Web Services, Hibernate/JAXB/Hyperjaxb2.&lt;br /&gt;&lt;br /&gt;So the work goes on just fine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-117559052135264486?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/117559052135264486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=117559052135264486' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/117559052135264486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/117559052135264486'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2007/04/hyperjaxb2-062-released.html' title='Hyperjaxb2 0.6.2 released'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-116065226497459529</id><published>2006-10-12T04:02:00.000-07:00</published><updated>2006-10-12T04:24:24.986-07:00</updated><title type='text'>Hyperjaxb progress</title><content type='html'>A lot has been done last weeks.&lt;br /&gt;&lt;br /&gt;I've release Hyperjaxb2 0.6.0 which became quite mature. I'm looking to make an 1.0.0 release in two weeks. Actually, the only thing to be done is the documentation. It's a bit obsolete so I have to refresh few sections. Promotial material. Nice presentations. Just to let people know.&lt;br /&gt;&lt;br /&gt;Other than that, Hyperjaxb2 is very nice right now. I've added sample projects (for Ant and Maven) - make it really easy to use.&lt;br /&gt;&lt;br /&gt;I've also worked on Hyperjaxb3. Well, this will be a killer. "Unschlagbar" as germans say.&lt;br /&gt;It seems like I'll have three main parts there: Hibernate, EJB3 and JDO.&lt;br /&gt;&lt;br /&gt;Hibernate part is just Hyperjaxb2 ported onto JAXB2. It generates *.hbm.xml and *.cfg.xml, that's it.&lt;br /&gt;This part work already. I've just deployed four test scenarios (out of 24) and they work and I see no reason the other 20 woul fail. I just have to deploy them. So this is ready to be released quite soon.&lt;br /&gt;&lt;br /&gt;As for EJB3 - I've been experimenting and achieve some progress.&lt;br /&gt;My first task was to write a roundtrip test case. I had to learn how to use the whole thing, how to package and so on. It's far from being trivial, and I was finally glad when i could roundtrip my XML in the frame of a unit test.&lt;br /&gt;&lt;br /&gt;After that I wrote a small ejb3 add-on for JAXB2. It adds EJB3 and Hibernate annotations to the classes generated by JAXB. And, finally, the "po" examle worked! Of course it's just the beginning, the test scenario is trivial, but it works.&lt;br /&gt;&lt;br /&gt;However I'm a bit upset with EJB3 spec. I think it's simply immature.&lt;br /&gt;What I'm missing is:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Support for collections of simple type. Without that you can't persist things like List&lt;String&gt;. And it's not unusual to have that in classes.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Custom types. EJB3 supports only a iminimal set of types. Just when you're a little bit above usual with the types you have in your classes, you're stuck. You can't persist things like URL or XMLGregorianCalendar and so on.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;No custom accessors. Just field or property.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;So the problem with EJB3 is that I can't use just EJB3 with JAXB. I need more and this means I have to become vendor-specific. I can surely imagine a vendor-independent solution but with a lot of additional code to cover all these "missing" cases. I think I'll start with Hibernate Entity Manager then TopLink Essentials then Kodo JDO...&lt;br /&gt;&lt;br /&gt;Today I've also made some experiments with JDO. I've taken a JPOX sample and made it work with Maven2. JDO seems to be pretty cool, I really liked that I could make a unit test run in less that 15 minutes. I liked so much that I'll surely support this in Hyperjaxb3. I even think I'll make the po test scenario run on JDO before I go on with further EJB3 implementations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-116065226497459529?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/116065226497459529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=116065226497459529' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/116065226497459529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/116065226497459529'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2006/10/hyperjaxb-progress.html' title='Hyperjaxb progress'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-115021901710611989</id><published>2006-06-13T10:10:00.000-07:00</published><updated>2006-06-13T10:20:17.046-07:00</updated><title type='text'>First roundtrip test case running with Hyperjaxb3</title><content type='html'>Today I've managed to execute the very first roundtrip test case with Hyperjaxb3. It's a primitive example with well-known purchase order schema, but it's a good starting point anyway. See &lt;code&gt;tests/po&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;In order to execute the test, you'll need to check out my changes to the JAXB 2 Maven plugin. Check out the &lt;code&gt;Lexi2&lt;/code&gt; branch from &lt;code&gt;jaxb2-sources/jaxb-maven2-plugin&lt;/code&gt; and &lt;code&gt;mvn install&lt;/code&gt; it. I hope we'll have these changes in the main branch (and maybe in the repository) soon, so it's a temporary inconvenience.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-115021901710611989?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/115021901710611989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=115021901710611989' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/115021901710611989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/115021901710611989'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2006/06/first-roundtrip-test-case-running-with.html' title='First roundtrip test case running with Hyperjaxb3'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-115010912104602845</id><published>2006-06-12T03:33:00.000-07:00</published><updated>2006-06-12T03:45:36.820-07:00</updated><title type='text'>Hyperjaxb3 - EJB3</title><content type='html'>Since I'm no EJB3 expert, I will really need assistance with EJB3 issues. I'll list my current EJB3 problems in this post. I'd be glad if experts comment.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;EJB3 roundtrip test case&lt;/h2&gt;&lt;br /&gt;I need a roundtrip test case for EJB3. I've described what roundtrip test case does in one of the previous posts (unmarshall, save, load, compare).&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;EJB3 and accessors&lt;/h2&gt;&lt;br /&gt;I use custom accessors with Hibernate3. First of all, they help with collection fields: JAXB generates no setter, and my custom accessor uses property-based getter and field-based setter to avoid the need to generate a collection setter. Another reason is that custom accessors may take advantage of &lt;code&gt;isSet&lt;em&gt;XXX&lt;/em&gt;&lt;/code&gt; methods generated by JAXB, for instance to distinguish &lt;code&gt;null&lt;/code&gt; and &lt;code&gt;0&lt;/code&gt; for primitive numeric types. Is it possible to condigure property accessors in EJB3?&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Collection of primitive types&lt;/h2&gt;&lt;br /&gt;How do I map a collection of primitive types (for instance strings) with EJB3? Something like &lt;code&gt;List&amp;lt;String&amp;gt;&lt;/code&gt;?&lt;br /&gt;&lt;br /&gt;I think it's all for now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-115010912104602845?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/115010912104602845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=115010912104602845' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/115010912104602845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/115010912104602845'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2006/06/hyperjaxb3-ejb3.html' title='Hyperjaxb3 - EJB3'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-115010841891396524</id><published>2006-06-12T03:26:00.000-07:00</published><updated>2006-06-12T03:33:38.913-07:00</updated><title type='text'>Hyperjaxb3  target platforms</title><content type='html'>Hyperjaxb2 only had a single target ORM platform and that was Hibernate/HBM file-based mappings. Hyperjaxb2 has literary generated HBM files for the classes generated by JAXB.&lt;br /&gt;&lt;br /&gt;In Hyperjaxb3, we'll have multiple target platforms. Hibernate3/HBM is one of the, but I'm looking forward to have EJB3/Hibernate3 with annotations or even JDO if it's somehow relevant.&lt;br /&gt;&lt;br /&gt;Each of the supported ORM platforms will have its own generating plugin. At the same time all the platforms will have the same analyzis block (detecting the cardinality and the type of the field). I think the strategy approach used in Hyperjaxb2 is quite reasonable to use here. We'll only need to implement a set of strategies (like single primitive field strategy, complex collection field strategy) for all of the platforms.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-115010841891396524?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/115010841891396524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=115010841891396524' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/115010841891396524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/115010841891396524'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2006/06/hyperjaxb3-target-platforms.html' title='Hyperjaxb3  target platforms'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-115010798057203356</id><published>2006-06-12T03:17:00.000-07:00</published><updated>2006-06-12T03:26:20.573-07:00</updated><title type='text'>Hyperjaxb3 roundtrip tests</title><content type='html'>Roundtrip tests are used within the integration testing in order to check if the generated O/R mapping (be it HBM files or annotations) are allright.&lt;br /&gt;&lt;br /&gt;Typical roundtrip test senario is as follows:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;  &lt;li&gt;Unmarshall the file/resource.&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Save the unmarshalled object into the database, memorize the id.&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Load the object from the database by the memorized id.&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Compare unmarshalled and loaded objects, check identity.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;I've already implemented a roundtrip test case for HBM file-based Hibernate mappings (see &lt;code&gt;org.jvnet.hyperjaxb3.hibernate.roundtrip.RoundtripTestCase&lt;/code&gt;). You only have to subclass this class in the target package and specify which sample files should be used for testing (see org.jvnet.hyperjaxb3.hibernate.roundtrip.tests.RoundtripTestCaseTest). The tests runs versus the in-memory HSQLDB database, database schema is automatically generated, very easy to use.&lt;br /&gt;&lt;br /&gt;I'll need such a roundtrip test for each for the target ORM platforms.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-115010798057203356?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/115010798057203356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=115010798057203356' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/115010798057203356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/115010798057203356'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2006/06/hyperjaxb3-roundtrip-tests.html' title='Hyperjaxb3 roundtrip tests'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-115010739651658694</id><published>2006-06-12T03:06:00.000-07:00</published><updated>2006-06-12T03:16:36.516-07:00</updated><title type='text'>Hyperjaxb3 tests</title><content type='html'>Hyperjaxb3 is primarily a code generation/augmentation library. This means we not only need to test how individual classes/methods work, we also have to check if code generation works as a whole.&lt;br /&gt;&lt;br /&gt;Therefore there are actually two types of tests:&lt;br /&gt;&lt;h2&gt;Unit tests&lt;/h2&gt;&lt;br /&gt;Test behaviour and functionality of individual classes and methods. Unit tests accompany the main code, they are stored in the &lt;code&gt;test&lt;/code&gt; directory (normal Maven convetions).&lt;br /&gt;&lt;h2&gt;Integrated tests&lt;/h2&gt;&lt;br /&gt;The overall process of code generation (generation, compilation, roundtrip testing) can only be implemented in separated test projects. Test projects are positioned as sub-modules of the &lt;code&gt;tests&lt;/code&gt; module. Each test project has its own &lt;code&gt;pom.xml&lt;/code&gt; file with all the definitions needed to build this project. Test projects should also contain the roundtrip test case/suite which is executed during the test phase.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-115010739651658694?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/115010739651658694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=115010739651658694' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/115010739651658694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/115010739651658694'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2006/06/hyperjaxb3-tests.html' title='Hyperjaxb3 tests'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-115010675896750523</id><published>2006-06-12T02:55:00.000-07:00</published><updated>2006-06-12T03:05:58.976-07:00</updated><title type='text'>Hyperjaxb3 project structure</title><content type='html'>Hyperjaxb3 consists of the following modules:&lt;br /&gt;&lt;h2&gt;hibernate-mapping&lt;/h2&gt;&lt;br /&gt;This module is the Hibernate Mapping DTD compiled compiled into Java classes using JAXB. This is used to generate Hibernate mappings as Java object structures rather than XML.&lt;br /&gt;&lt;h2&gt;tools&lt;/h2&gt;&lt;br /&gt;Utility package analogous to the jaxbcommons project for JAXB 1.x. This module contains all kinds of tools for JAXb and XJC. At the same time there is no runtime code in this package.&lt;br /&gt;&lt;h2&gt;core&lt;/h2&gt;&lt;br /&gt;Core generation module. This module will actually contain plugins to generate mappings and/or annotations.&lt;br /&gt;&lt;h2&gt;runtime&lt;/h2&gt;&lt;br /&gt;Classes used in the runtime, for instance Hibernate accessors or custom types. This will be the only module/jar used in the runtime.&lt;br /&gt;&lt;h2&gt;testing&lt;/h2&gt;&lt;br /&gt;Testing routines. Among others contains plugin test cases and roundtrip test cases.&lt;br /&gt;&lt;h2&gt;tests&lt;/h2&gt;&lt;br /&gt;This module contains test projects.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-115010675896750523?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/115010675896750523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=115010675896750523' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/115010675896750523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/115010675896750523'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2006/06/hyperjaxb3-project-structure.html' title='Hyperjaxb3 project structure'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28887898.post-114884139377336344</id><published>2006-05-28T11:34:00.000-07:00</published><updated>2006-05-28T11:36:33.780-07:00</updated><title type='text'>The first post</title><content type='html'>This blog is intended as my technical journal on the things I used to, do, or plan to develop. I'm no technology evangelist anymore, just have to track and gather some of my thoughts for them not to get lost.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28887898-114884139377336344?l=lexicore.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lexicore.blogspot.com/feeds/114884139377336344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28887898&amp;postID=114884139377336344' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/114884139377336344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28887898/posts/default/114884139377336344'/><link rel='alternate' type='text/html' href='http://lexicore.blogspot.com/2006/05/first-post.html' title='The first post'/><author><name>Aleksei Valikov</name><uri>http://www.blogger.com/profile/08429977216315633477</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
