Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for mapping enums from ex. Java #7

Open
natami opened this issue Dec 2, 2013 · 0 comments
Open

Support for mapping enums from ex. Java #7

natami opened this issue Dec 2, 2013 · 0 comments

Comments

@natami
Copy link

natami commented Dec 2, 2013

Currently i'm using the tool to map from Java to As3.

In my project i employ a number of Java Enums.

The as3 counterpart would look the following:
public class Locale extends Enum {

public static var DA:Locale = new Locale("DA");
public static var EN:Locale = new Locale("EN");

function Locale(enumName:String) {
    super(enumName);
}

public static function valueOf(enumName:String):Locale {
    return Locale(DA.constantOf(enumName));
}

override protected function getConstants():Array {
    return [DA, EN];
}

}

Currently there seems to be no support for this type of "fake" enums in the As3Vanilla project. This could be a great benefit for json->as3 developers to ensuring real enum support, in favor of the old "string" based types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant