commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@btopenworld.com
Subject Re: Typed Accessors
Date Tue, 18 Mar 2003 18:28:33 GMT
Its not dissimilar to some stuff I have done at joda.sourceforge.net. You might want to take
a look at that.

Stephen

>  from:    "KNOX, Liam, FM" <Liam.Knox@rbos.com>
>  date:    Tue, 18 Mar 2003 11:24:28
>  to:      commons-dev@jakarta.apache.org
>  subject: Re: Typed Accessors
> 
> Hello 
> 
> I was wondering if there was any code in commons (probably lang) providing
> typed accessor support.
> As you probably know with Java you have System.getProperty() which returns
> strings only, Map
> interface which returns Object, and code can become messy casting, using
> .intValue() etc.
> Within some of the projects I have worked on I have implemented a typed
> accessor interface to reduce
> this overhead i.e.
> 
>   public interface  PropertyAccessor {
> 	public int getIntValue(String name);
> 	public int getIntValue(String name,int default);
> 	
> 	// etc
>   } 
> 
> It is also easy to see how you can write implementations of this for Maps,
> HttpServletRequest etc. I was wondering
> if there is anything like this in commons, or if not would anyone like me to
> contribute this ?
> 
> Thanks
> 
> Liam
> 
> 
> ********************************************************************
>       Visit our Internet site at http://www.rbsmarkets.com
> 
> This e-mail is intended only for the addressee named above.
> As this e-mail may contain confidential or privileged information,
> if you are not the named addressee, you are not authorised to
> retain, read, copy or disseminate this message or any part of it.
> The Royal Bank of Scotland plc is registered in Scotland No 90312
> Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
>              Regulated by the Financial Services Authority
> ********************************************************************
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


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


Mime
View raw message