Ken,

Enums might be tricky... I believe this is the first question I've had
about them in over 10 years.
What are you expecting "valueOf" to return?

Patrick


On Thu, Aug 18, 2011 at 5:41 PM,  <ken.willi...@thomsonreuters.com> wrote:
> I've got a class like so:
>
> ----------------
> package com.my.company;
> public class TokenFSM {
>    public static enum TokenType {
>        ALPHAID,
>        APOS
>    }
> }
> ----------------
>
> I'd like to access various enum constants from Perl code, something like
> the following (which doesn't work):
>
>
> ----------------
> use Inline (Java => "STUDY",
>            CLASSPATH => "foo.jar",
>            AUTOSTUDY => 1,
>            STUDY=> ["com.my.company.TokenFSM"],
>            JNI=>1);
> print $com::my::company::TokenFSM::TokenType->valueOf("APOS");
> ----------------
>
> That dies with:    Can't call method "valueOf" on an undefined value at -e
> line 1.
>
>
> Anyone have better fu with this?
>
>  -Ken
>
>



-- 
=====================
Patrick LeBoutillier
Rosemère, Québec, Canada

Reply via email to