public ClientLayerTreeNodeInfo securityClone(ClientLayerTreeNodeInfo original) {
// the data is explicitly copied as this assures the security is considered when copying.
if (null == original) {
return null;
}
ClientLayerTreeNodeInfo client = new ClientLayerTreeNodeInfo();
client.setLabel(original.getLabel());
client.setExpanded(original.isExpanded());
List<ClientLayerInfo> layers = new ArrayList<ClientLayerInfo>();
client.setLayers(layers);
for (ClientLayerInfo layer : original.getLayers()) {
ClientLayerInfo copy = securityClone(layer);
if (null != copy) {
layers.add(copy);
}
}
List<ClientLayerTreeNodeInfo> nodes = new ArrayList<ClientLayerTreeNodeInfo>();
client.setTreeNodes(nodes);
for (ClientLayerTreeNodeInfo node : original.getTreeNodes()) {
ClientLayerTreeNodeInfo copy = securityClone(node);
if (null != copy) {
nodes.add(copy);
}
}
if (layers.size() > 0 || nodes.size() > 0) {