protected long adjustNodeIds(CObject cobj, long count) throws FlatteningException { if (cobj.getNodeId() != null) { count++; cobj.setNodeId(formatNodeId(count)); } if (cobj instanceof CComplexObject) { for (CAttribute attr : ((CComplexObject) cobj).getAttributes()) { for (CObject child : attr.getChildren()) { count = adjustNodeIds(child, count); } } } return count; }
/** * Overwrite recursively all the nodeIds in the given cobj tree with * incremental number starting with given count value * * @param ccobj * @param diff * @return total number of nodeIds adjusted, used to update nodeId counter */ protected long adjustNodeIds(CObject cobj, long count) throws FlatteningException { if(cobj.getNodeId() != null) { count++; cobj.setNodeId(formatNodeId(count)); } if(cobj instanceof CComplexObject) { for(CAttribute attr : ((CComplexObject) cobj).getAttributes()) { for(CObject child : attr.getChildren()) { count = adjustNodeIds(child, count); } } } return count; }
/** * Overwrite recursively all the nodeIds in the given cobj tree with * incremental number starting with given count value * * @param ccobj * @param diff * @return total number of nodeIds adjusted, used to update nodeId counter */ protected long adjustNodeIds(CObject cobj, long count) throws FlatteningException { if(cobj.getNodeId() != null) { count++; cobj.setNodeId(formatNodeId(count)); } if(cobj instanceof CComplexObject) { for(CAttribute attr : ((CComplexObject) cobj).getAttributes()) { for(CObject child : attr.getChildren()) { count = adjustNodeIds(child, count); } } } return count; }