Re: ANT task to process properties-files into static class

2007-01-03 Thread Donald McLean
Rapthor wrote: Donald McLean wrote: Really? That sounds like a case of "The cure is worse than the disease." I can't imagine a single case where something like that would be a better solution than the three or four techniques for providing static attributes that I'm already familiar with.

Re: ANT task to process properties-files into static class

2007-01-03 Thread Steve Loughran
Keith Hatton wrote: Two more robust solutions spring to mind: 1. You can use Properties.getProperty(String,String) to prevent your NPE. The first string is the property name, the second is a default value to be used when the property is not present. http://java.sun.com/j2se/1.5.0/docs/api/java/u

RE: ANT task to process properties-files into static class

2007-01-03 Thread Keith Hatton
2007 21:42 To: user@ant.apache.org Subject: Re: ANT task to process properties-files into static class Scot P. Floess wrote: > > If a property does not exist, why is a null pointer thrown? I assume > you mean java.util.Properties? If so, that does not raise a null > pointer except

Re: ANT task to process properties-files into static class

2007-01-02 Thread James Abley
If that's the sort of thing you're after, Log4J has a similar mechanism which can monitor the config file and polls to see if it needs to reload the configuration. [1] I think that would provide a template for you. YMMV. Cheers, James [1] http://logging.apache.org/log4j/docs/api/org/apache/

Re: ANT task to process properties-files into static class

2007-01-02 Thread Alexey N. Solofnenko
It seems a trivial task to generate a Java source file from a property with . - Alexey. Rapthor wrote: Sorry, having confused you. I have a file named global.properties. This file is edited manually by me. The webapplication loads this file into a java.util.Properties-instance at start. Eve

Re: ANT task to process properties-files into static class

2007-01-02 Thread Rapthor
heck whether a "null" is returned or not. This check is at runtime! I wanted to see these at compile time. And that would be possible with a static class with attributes. -- View this message in context: http://www.nabble.com/ANT-task-to-process-properties-files-into-static-class-tf29094

Re: ANT task to process properties-files into static class

2007-01-02 Thread Scot P. Floess
Sorry, I'm not sure I follow your problem... Do you mean Ant should somehow generate a properties file based upon your build.xml properties? Who sets the properties and how is this null pointer being raised? I am a "wee" bit confused ;) Rapthor wrote: Scot P. Floess wrote: If a property

Re: ANT task to process properties-files into static class

2007-01-02 Thread Rapthor
mechanism to create a static class does not confirm with that idea. -- View this message in context: http://www.nabble.com/ANT-task-to-process-properties-files-into-static-class-tf2909466.html#a8131373 Sent from the Ant - Users mailing list archive at Nabble.com. ---

Re: ANT task to process properties-files into static class

2007-01-02 Thread Rapthor
e read from the Properties instance. (If no matching key was present in the file.) -- View this message in context: http://www.nabble.com/ANT-task-to-process-properties-files-into-static-class-tf2909466.html#a8131316 Sent from the Ant - Users mailing list archiv

Re: ANT task to process properties-files into static class

2007-01-02 Thread Rapthor
et you right? -- View this message in context: http://www.nabble.com/ANT-task-to-process-properties-files-into-static-class-tf2909466.html#a8131286 Sent from the Ant - Users mailing list archive at Nabble.com. - To unsubscribe, e-

Re: ANT task to process properties-files into static class

2007-01-02 Thread Donald McLean
Really? That sounds like a case of "The cure is worse than the disease." I can't imagine a single case where something like that would be a better solution than the three or four techniques for providing static attributes that I'm already familiar with. However, of course, YMMV. Rapthor wrot

Re: ANT task to process properties-files into static class

2007-01-02 Thread Scot P. Floess
If a property does not exist, why is a null pointer thrown? I assume you mean java.util.Properties? If so, that does not raise a null pointer exception. Rapthor wrote: Hi, I think this problem is very interesting. I have a web application that needs various configuration. I'm using a proper

ANT task to process properties-files into static class

2007-01-02 Thread Rapthor
/www.nabble.com/ANT-task-to-process-properties-files-into-static-class-tf2909466.html#a8128739 Sent from the Ant - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]