Accessing C++ Enums In Java

Contents

Introduction

Accessing C++ enums in Java is implemented via a Python script which analyzes the C++ enum and spits out the corresponding Java class. The enum needs to be annotated in a particular way. By default, the generated class name will be the same as the name of the enum. If all the names of the enum values are prefixed with the MACRO_CASED_ name of the enum those prefixes will be stripped from the Java version.

Features

Customize the package name of the generated class using the GENERATED_JAVA_ENUM_PACKAGE directive (required)

Customize the class name using the GENERATED_JAVA_CLASS_NAME_OVERRIDE directive (optional)

Strip enum entry prefixes to make the generated classes less verbose using the GENERATED_JAVA_PREFIX_TO_STRIP directive (optional)