Issue Details (XML | Word | Printable)

Key: GDS-670
Type: New Feature New Feature
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Franck Wolff
Reporter: Luan Nguyen
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
GraniteDS

Extends enum generator to support description/descriptive strings

Created: 07/Apr/10 04:30 PM   Updated: 23/Nov/10 12:58 PM   Resolved: 23/Nov/10 12:58 PM
Component/s: AS3 code generation
Affects Version/s: 2.1.0_GA
Fix Version/s: None

Environment: Eclipse/Windows/Flex


 Description  « Hide
In our project, we have enums with descriptive fields. The generator doesn't expose these fields in the base class and we had to modified the JavaEnum class and enum.gsp to get it working. We would like to keep up with your nightly builds but this requires us to change JavaEnum and enum.gsp every single time. Could the feature be added into the release? I can provide the modified code. For example:

public enum JediType {
    LUKE("Luke Skywalker"),
    HAN("Han Solo"),
    YODA("Yoda")

    private final String description;

    JediType(String description) {
        this.description = description;
    }

    public String getDescription() {
        return description;
    }
}

GETS generate as:

    public class JediType Enum {
        public static const LUKE:JediType = new JediType ("LUKE", ""Luke Skywalker", _);
        ....
        function JediType (value:String = null, description:String = null, restrictor:* = null) {
            super((value || DRAFT.name), restrictor);
            this._description = description;
        }
        ....
        public function get description():String {
            return this._description;
        }

There are no comments yet on this issue.