commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <heg...@med.uni-marburg.de>
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.

Oliver

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 <mail@numerixtechnology.de>
> Reply-To: mail@numerixtechnology.de
> To: commons-user@jakarta.apache.org
> 
> Hello,
> 
> I would like to specify a regular expression as a string property.
> Example:
> first.name.pattern=.{0,30}
> 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
mailto:oliver.heger@med.uni-marburg.de

---------------------------------------------------------------------
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