guicamest/InterfaceToDTO — Issue #6: Add a method to use DTO generation for fields with same interface
Author: guicamest
Created: 2011-10-13 03:22:08+00:00
State: open

public class Node implements INode {
...
INode fatherNode;
INode childNode;
...
INode getFather();
Node getChild();
...
}

and the following code:

Node father = new Node();
Node child = new Node();
Node intermediate = new Node(father, child);
father.setChild(intermediate);
child.setFather(intermediate);

When doing something like:
INode node = InterfaceDTOUtils.getFilledDto(INode.class, intermediate, TRUE);

not just the intermediate node should be a INodeDTO, but also his father.
Note that his child won't be a INodeDTO, because the method's return type is
a Node and it could be implementing several interfaces.