commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <>
Subject Re: [Re: [configuration] specify a regular expression as string property]
Date Wed, 21 Apr 2004 12:44:37 GMT
The interpretation of properties takes place in the addProperty() method 
of AbstractConfiguration. For String properties it essentially boils 
down to a special tokenizer class PropertiesTokenizer, which uses the 
comma "," as delimiter to split the string into a list. If I don't miss 
anything, I don't see a possibility to alter this behaviour, e.g. by 
escaping the comma.

I remember that there was a discussion on the developer list a while ago 
about the subjects list handling and escaping of string properties. You 
may find something in the archieves, or maybe somebody chimes in who 
knows more about this.

The type of the properties you get also depents on the getter methods 
you use. Properties read from a file are usually stored as strings (or 
lists of strings if they contain a comma). If you call getInt() for 
instance, the method tries to convert the property into an int.


T E Schmitz schrieb:

> I realize that the question below was rather too specific for anyone to 
> know the answer off-hand.
> But does anyone know what determines whether a property is interpreted 
> as String, Float, Integer or ArrayList?
> Regards,
> Tarlika Elisabeth Schmitz
> -------- Original Message --------
> Subject: [configuration] specify a regular expression as string property
> Date: Sun, 18 Apr 2004 00:39:20 +0100
> From: T E Schmitz <>
> Reply-To:
> To:
> Hello,
> I would like to specify a regular expression as a string property.
> Example:
> or alternatively in an xml configuration file:
> <pattern>.{0,30}</pattern>
> Unfortunately this expression is interpreted as ArrayList. Is there any
> way to escape it so that it will be interpreted as a String?
> Any help is very much appreciated.

Dipl.-Inform. Oliver Heger
Zentrale Informationsverarbeitung (ZIV) / Bereich Anwenderverfahren
Klinikum der Philipps-Universit├Ąt Marburg
Bunsenstra├če 3,
D-35037 Marburg
Tel: +49 6421 28-66592

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

View raw message