Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #1240

Re: Dynamic enums

From Eric Sosman <esosman@ieee-dot-org.invalid>
Newsgroups comp.lang.java.help
Subject Re: Dynamic enums
Date 2011-10-11 22:11 -0400
Organization A noiseless patient Spider
Message-ID <j72t18$1u6$1@dont-email.me> (permalink)
References <4e94eeb1$0$16274$9a566e8b@news.aliant.net> <j72sn7$cl$1@dont-email.me>

Show all headers | View raw


On 10/11/2011 10:05 PM, Eric Sosman wrote:
> [...]
> No. The names of enum constants are compile-time artifacts,
> just like the names of local variables. At run-time, all such
> things have disappeared (well, they may survive in ancillary debug
> data, but the C language has no access to such things).

     Oh, ratzafratz: I forgot which newsgroup I was in.  The *Java*
language has access to this sort of information via reflection.
Still, the information is very nearly read-only, and reflection
can't inject a new enum into the mix.  (Java can, of course, load
a new .class with a new definition for the enum -- but that just
introduces a different enum class that happens to have the same
name, under the scope of a different classloader.)

-- 
Eric Sosman
esosman@ieee-dot-org.invalid

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Dynamic enums Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-12 01:34 +0000
  Re: Dynamic enums Lew <lewbloch@gmail.com> - 2011-10-11 19:03 -0700
  Re: Dynamic enums Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-10-11 22:05 -0400
    Re: Dynamic enums Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-10-11 22:11 -0400
      Re: Dynamic enums Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-12 06:02 +0000
        Re: Dynamic enums markspace <-@.> - 2011-10-11 23:44 -0700
        Re: Dynamic enums Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-10-12 07:58 -0400
          Re: Dynamic enums markspace <-@.> - 2011-10-12 07:46 -0700
  Re: Dynamic enums markspace <-@.> - 2011-10-11 19:32 -0700
  Re: Dynamic enums Roedy Green <see_website@mindprod.com.invalid> - 2011-10-12 07:02 -0700

csiph-web