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.
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
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
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/
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
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
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
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.
---
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
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-
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
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
/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]
13 matches
Mail list logo