Note that there are some explanatory texts on larger screens.

plurals
  1. POCustomizing Granite DS Actionscript code generation from Java classes
    primarykey
    data
    text
    <p>I'm using <a href="http://www.graniteds.org/confluence/display/DOC20/3.+Gas3+Template+Language" rel="nofollow noreferrer">GraniteDS Actionscript code generation templates</a> that let's me take a Java object and convert it to an Actionscript class. </p> <p>It's mainly used for BlazeDS Java to Flash communication but I'm adapting it to work with JSON webservices using XStream/JETTISON JSON.</p> <p>Is it possible to use the Granite DS Groovy templates to inspect annotations on a Java class and use that to generate the code bindings?</p> <p>For example I create an @XStreamAlias to shorten the class name when sent through JSON, but I need my Actionscript generated classes to support that as well.</p> <pre><code>package com.webwars.game; @XStreamAlias("UnitStack") public class UnitStack implements Serializable { </code></pre> <p>I want my Actionscript generated code to be:</p> <pre><code>package com.webwars.gameplatform.combat.pvp { [Bindable] [RemoteClass(alias="UnitStack")] public class UnitStack extends UnitStackBase { </code></pre> <p>Is this possible with the groovy templates? </p> <p>I can't seem to find any documentation on what properties are available in the GraniteDS Groovy Template JavaType? The documentation listed on the GraniteDS site for JavaType goes to a broken Javadoc link.</p> <p>For example in my bean.gsp can I do something like:</p> <pre><code>&lt;% /////////////////////////////////////////////////////////////////////////// // Use the XStreamAlias annotation as the classname def alias = jClass.qualifiedName; if (jClass.hasAnnotation("XStreamAlias)) { alias = jClass.getAnnotation("XStreamAlias"); } %&gt; [Bindable] [RemoteClass(alias="${alias}")] public class ${jClass.as3Type.name} extends ${jClass.as3Type.name}Base {&lt;% </code></pre>
    singulars
    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.
 

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