as3-vanilla
as3-vanilla copied to clipboard
Support for mapping enums from ex. Java
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.