I am using dozer framework for cloning my objects. I want dozer framework to clone the data without using the getters and setters and for this I am setting the is-accessible property at the class level. But this does not seem to work. When I set is-accessible at field level it works fine.
BeanMappingBuilder builder = new BeanMappingBuilder(){
@Override
protected void configure() {
mapping(type(A.class).accessible(true),type(A.class).accessible(true)).exclude("field1").exclude("field2");
}
};
m.addMapping(builder);
The reason why I wanted use is-accessible is because I have a field in class A which is declared as
private SortedSet<String> foo;
but the getter is like
public Collection<String> getFoo()
{
return foo;
}
I think dozer cannot find the getter as it is returning a different type for the field foo. Can someone tell me if this is a bug in dozer or Is it something I am doing wrong?
Thanks in advance for your help!!