commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KNOX, Liam, FM" <Liam.K...@rbos.com>
Subject Typed Accessors
Date Tue, 18 Mar 2003 11:24:28 GMT
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


Mime
View raw message