ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dick, Brian E." <Brian.D...@FMR.com>
Subject RE: Antwort: Re: Displaying the value in a Java class?
Date Fri, 10 Feb 2006 16:17:43 GMT
You could also use the script task to load the class and print the
value.

-----Original Message-----
From: dvholten@computer.org [mailto:dvholten@computer.org] 
Sent: Friday, February 10, 2006 11:11 AM
To: Ant Users List
Subject: Antwort: Re: Displaying the value in a Java class?


Hello,

i think, what you try to do doesnt work this way.
The BCEL - thing reads the class-file, knows about the internal layout
and 
can find out things about it.
One of these is the constant - pool. Strings, doubles, long constants
are 
put there by the compiler

your public final static xxxx  is not included there. It is a 
(class-)member, which contains a reference to
some other object (probably in another class). This reference is
resolved 
when the class is loaded (simplfied).
So, i would be surprised if you find what you are looking for in your 
class-file.

I would go another way: because the class-file is available for ant, why

not write a simple task to instantiate your class,
query the property and convert the result to a string. 
Some template for a user-defined task should be available somewhere.

HTH
dvholten

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message