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


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

Re: Dynamic enums

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From Eric Sosman <esosman@ieee-dot-org.invalid>
Newsgroups comp.lang.java.help
Subject Re: Dynamic enums
Date Tue, 11 Oct 2011 22:11:45 -0400
Organization A noiseless patient Spider
Lines 18
Message-ID <j72t18$1u6$1@dont-email.me> (permalink)
References <4e94eeb1$0$16274$9a566e8b@news.aliant.net> <j72sn7$cl$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Wed, 12 Oct 2011 02:11:52 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="f8igmItKsWs6nM5YanFxAA"; logging-data="1990"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19srHH2aHAxr7GTjMHCNYcc"
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
In-Reply-To <j72sn7$cl$1@dont-email.me>
Cancel-Lock sha1:JJHpIfAbL4IyfxcQJGw6iQtuLvY=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.help:1240

Show key headers only | 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