{"id":240,"date":"2008-09-13T12:49:24","date_gmt":"2008-09-13T11:49:24","guid":{"rendered":"http:\/\/blog.sahits.ch\/?p=240"},"modified":"2017-12-24T21:42:28","modified_gmt":"2017-12-24T20:42:28","slug":"in-three-steps-to-your-java-emitter-template","status":"publish","type":"post","link":"http:\/\/sahits.ch\/blog\/blog\/2008\/09\/13\/in-three-steps-to-your-java-emitter-template\/","title":{"rendered":"In Three steps to your Java Emitter template"},"content":{"rendered":"<p>Creating a Java Emitter Template (JET) is no easy feat, but if you have the right infrastructure set up it&#8217;s not that difficult.<br \/>\nThis article is based on the <a href=\"https:\/\/sourceforge.net\/projects\/codegenjava\">Java Code Generator<\/a> plug-in for Eclipse.<br \/>\n<!--more--><br \/>\nTo cook up a JET easily you need three ingredients:<\/p>\n<ol>\n<li>A class that should be produced with the template, so you can see what goes into the template<\/li>\n<li>A helper class that converts and\/or generates\/transforms data from your model into a string<\/li>\n<li>A Java Emitter Template template &#8211; a basic template that can generate an empty class rump<\/li>\n<\/ol>\n<p>As the JET template we can use the <a href=\"http:\/\/codegenjava.svn.sourceforge.net\/viewvc\/codegenjava\/plugin\/jet_templates\/rump.javajet\">rump.javajet<\/a> file from the plugin. If you design your class to have generic methods that don&#8217;t depend on the actual model or model data you can copy a good part of your template class into the JET. Where this is not an option the helper class will help out since everything in the JET is a string.<br \/>\n<a href=\"http:\/\/sourceforge.net\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/sflogo.sourceforge.net\/sflogo.php?group_id=215228&amp;type=5\" width=\"210\" height=\"62\" border=\"0\" alt=\"SourceForge.net Logo\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating a Java Emitter Template (JET) is no easy feat, but if you have the right infrastructure set up it&#8217;s not that difficult. This article is based on the Java Code Generator plug-in for Eclipse.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,7,6],"tags":[304,301,93,300],"class_list":["post-240","post","type-post","status-publish","format-standard","hentry","category-eclipse","category-java","category-programmieren","tag-eclipse","tag-java","tag-jet","tag-programmieren"],"_links":{"self":[{"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/posts\/240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/comments?post=240"}],"version-history":[{"count":3,"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/posts\/240\/revisions"}],"predecessor-version":[{"id":276,"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/posts\/240\/revisions\/276"}],"wp:attachment":[{"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/media?parent=240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/categories?post=240"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sahits.ch\/blog\/wp-json\/wp\/v2\/tags?post=240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}