
|
If you were logged in you would be able to see more operations.
|
|
|
|
For now I added the functionality myself, but can this feature be added in the next release? Otherwise we can't follow the next releases of this great tool and we're stuck with our version.
What I did myself:
I added support for 2 kinds of annotations to the generator:
- "annotationClassname": classes with this annotation are selected for generation of an AS3 equivalent
- "enumPropertyClassname": property getters of an enum with this annotation are taken along in the generation. That is, in the enum template you will have access to a "properties" variable like in beanBase template.
I attached the files that I've changed from the generator/builder project. I started from the 2.0.0_B1 version.
Brief Summary:
- AntJavaAs3Task.java
Added support for 2 extra attributes:
- annotationClassname: will be used to scan the given fileset for this annotation's presence. If present, AS3 equivalent will be generated
- enumPropertyAnnotationClassname: will be used by the JavaEnum class (read further on) to take extra defined properties of an enum along in the generation
- JavaEnum.java
Support for enum properties, together with a custom enum.gsp (Groovy Template, see project where build.xml uses the AntJavaAs3Task Ant task)
That is: if properties are marked with the "enumPropertyAnnotationClassname", defined as attribute of the Ant task, they will be taken also in the generation as extra properties in the AS3 enum equivalent.
That way, we don't loose these settings we created in Java Enums..
- JavaAs3GroovyTransformer.java
Support for "enumPropertyAnnotationClassname" property that will be passed to a JavaEnum class instance (see higher)
Thanks in advance!!
|
|
Description
|
For now I added the functionality myself, but can this feature be added in the next release? Otherwise we can't follow the next releases of this great tool and we're stuck with our version.
What I did myself:
I added support for 2 kinds of annotations to the generator:
- "annotationClassname": classes with this annotation are selected for generation of an AS3 equivalent
- "enumPropertyClassname": property getters of an enum with this annotation are taken along in the generation. That is, in the enum template you will have access to a "properties" variable like in beanBase template.
I attached the files that I've changed from the generator/builder project. I started from the 2.0.0_B1 version.
Brief Summary:
- AntJavaAs3Task.java
Added support for 2 extra attributes:
- annotationClassname: will be used to scan the given fileset for this annotation's presence. If present, AS3 equivalent will be generated
- enumPropertyAnnotationClassname: will be used by the JavaEnum class (read further on) to take extra defined properties of an enum along in the generation
- JavaEnum.java
Support for enum properties, together with a custom enum.gsp (Groovy Template, see project where build.xml uses the AntJavaAs3Task Ant task)
That is: if properties are marked with the "enumPropertyAnnotationClassname", defined as attribute of the Ant task, they will be taken also in the generation as extra properties in the AS3 enum equivalent.
That way, we don't loose these settings we created in Java Enums..
- JavaAs3GroovyTransformer.java
Support for "enumPropertyAnnotationClassname" property that will be passed to a JavaEnum class instance (see higher)
Thanks in advance!! |
Show » |
Sort Order:
|
There is however some overlap with GDS-494 concerning enums and we are not sure what option to choose (having a enum.gsp/enumBase.gsp would allow you to have