commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DECOKER, Lydie \(Lydie\)" <>
Subject getProperty method for XMLConfiguration - Bug?
Date Thu, 03 May 2007 12:26:07 GMT
I just started to use common configuration package today (version 1.4).
I am using it to read an XML configuration files. Looking the user
documentation, I used the getProperty method to read the below section
from XML:
		<QueueName QueueType="Queue">QueueName3</QueueName>
		<QueueName QueueType="Queue">QueueName4</QueueName>

As I do not know the number of IncomingGateway elements, it helps a lot.
But if I only have one IncomingGateway element, it does not work.

The way I did it is as follows:

Object prop = config.getProperty(key);
if (prop instanceof Collection) {
	// Get the number of gateways to be defined
	int nbGateway = ((Collection)prop).size();
	System.out.println("Number of gateway: " + nbGateway);

Did I miss something?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message