commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <oliver.he...@oliver-heger.de>
Subject Re: [Commons-Configuration] setDelimiter
Date Mon, 17 Jul 2006 20:01:01 GMT
Neil Benn wrote:
> Hello,
> 
>         I've done some scans on this but not really found anything which
> will help me.  I'm loading in this snippet of XMLfrom a file:
> 
> <ProcessorString><![CDATA[select c.barcode,  c.volume,  c.concentration 
> from
> container c where c.barcode in (?)]]></ProcessorString>
> 
>  As you can see it has commas in it, so I reread the docs and it states
> that this is parsed and tokenises the return String.  To avoid this I need
> to set the delimiter on AbstractConfiguration so I have this code:
> 
>            AbstractConfiguration.setDelimiter((char) 0);
>            String strScript = objXMLConf.getString(strDPRoot +
>                    ".ProcessorString");
>            AbstractConfiguration.setDelimiter(',');
> 
>  However it still splits the string up as shown by the logging output :
> 
> 0 [main] DEBUG uk.co.ziath.datapaq.server.DataPaqConfigLoader  - script -
> select c.barcode
> 
>  Does anyone know if the setDelimiter method is functional and/or what I am
> doing wrong?
> 
> Setup :
> 
> XMLConfiguration (from a file on local hard drive)
> Non validating
> JDK1.5
> Commons config 1.2 (size - 139,966 bytes)
> 
>  Thanks, in advance for your help.
> 
> Cheers,
> 
> Neil
> 

It's not really clear from your posting, but I suppose you call 
setDelimiter() after you have loaded the configuration file. However the 
splitting is performed during the load operation, so you have to call 
the method before.

Oliver

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


Mime
View raw message