0.0.1 • Published 6 years ago

java-enum-loader v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Loads all of the Enum types declared in a Java source file.

This may be useful if you're writing code that interfaces with a Java app and you want to be able to communicate the same values between the front- and back-end.

Usage

npm install --save-dev json-loader
module.exports = {
  module: {
    loaders: [
      {
        test: /\.java$/,
        loader: "java-enum-loader"
      }
    ]
  }
};
var enumValues = require("src/MyClass.java");

// if MyClass.java defines an enum called "Colors" with values:
//
// RED, GREEN, NAVY_BLUE
//
// enumValues will now look like:
//
// { colors: {red: "RED", green: "GREEN", navyBlue: "NAVY_BLUE"}}