Created
December 15, 2014 18:37
-
-
Save clebertsuconic/be31b2789e7271db002b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final BeanUtilsBean2 beanUtils = new BeanUtilsBean2(); | |
static | |
{ | |
// This is to customize the BeanUtils to use Fluent Proeprties as well | |
beanUtils.getPropertyUtils().addBeanIntrospector(new FluentPropertyBeanIntrospector()); | |
} | |
public T setData(URI uri, T obj) throws Exception | |
{ | |
obj.setHost(uri.getHost()); | |
obj.setPort(uri.getPort()); | |
obj.setUserInfo(uri.getUserInfo()); | |
synchronized (beanUtils) | |
{ | |
beanUtils.populate(obj, parseQuery(uri.getQuery())); | |
} | |
return obj; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment