|
BeanIO 2.0.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.beanio.internal.util.Replicator
public class Replicator
Utility class used to copy a hierarchical object graph.
If all nodes in the graph implement Replicateable
and are registered
using register(Replicateable)
, calling replicate(Object)
and passing the root node in the graph will clone all registered nodes and
return a copy of the root node with references to copies of its descendents.
Constructor Summary | |
---|---|
Replicator()
Constructs a new Replicator. |
Method Summary | ||
---|---|---|
void |
register(Replicateable node)
Registers a node in a graph that can be copied. |
|
|
replicate(T value)
Returns a copy of the registered graph node and its descendants. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Replicator()
Method Detail |
---|
public void register(Replicateable node)
node
- the graph node to registerpublic <T> T replicate(T value)
T
- the node typevalue
- the root graph node
IllegalStateException
- if value is not a registered node
|
BeanIO 2.0.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |