You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Neil Benn <ne...@gmail.com> on 2006/07/16 20:48:57 UTC

[Commons-Configuration] setDelimiter

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

Re: [Commons-Configuration] setDelimiter

Posted by Oliver Heger <ol...@oliver-heger.de>.
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