ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rapthor <rapt...@lycos.de>
Subject ANT task to process properties-files into static class
Date Tue, 02 Jan 2007 19:01:13 GMT

Hi,

I think this problem is very interesting. I have a web application that
needs various configuration. I'm using a properties file that is loaded into
a Properties-class.

The problem arrises when runtime exceptions are thrown
(NullPointerException) by using:

String value = props.getProperty("myProp");

(In this case the entry "myProp" is not available.)

The solution would be to process the properties file and put all keys and
values into a class with public static attributes:

class Props {
public static String myProp = "123";
.....
}

This processing should be done with ANT! It shall create a JAVA file before
the general compilation task. This would be great and runtime exceptions
concerning a lack of propertie-keys are extinguished forever.

Is there any tool for ANT that helps?

Thanks in advance.
-- 
View this message in context: http://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: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message