arton / rjb

Ruby Java Bridge
https://www.artonx.org/collabo/backyard/?RubyJavaBridge
GNU Lesser General Public License v2.1
117 stars 34 forks source link

How to extract enums ? #22

Closed spatil closed 11 years ago

spatil commented 11 years ago

This is the enum defined in jar file

public enum BarcodeFormat { AZTEC, CODABAR, CODE_39, CODE_93, CODE_128, DATA_MATRIX, EAN_8, EAN_13, ITF }

I did this require 'rjb' Rjb::load("./lib/core.jar")

BarcodeFormat = Rjb::import("com.google.zxing.BarcodeFormat") Is there any method from Which I can get the enum ?

I get the name using BarcodeFormat.values().last.name() but its string

Any help ?

spatil commented 11 years ago

Sorry I got the solution !!