private void visit(final ObjectGraphNode currentNode) {
		Object currentValue = currentNode.getValue();

		if (currentValue == null
				|| (currentValue instanceof java.lang.ref.SoftReference)
				|| currentNode.isPrimitive() || currentNode.isSimpleType()) {
			return;
		}

		if (isObjectVisited(currentNode)) {
			ObjectGraphNode ref = visitedNodes.get(currentValue);
			currentNode.setRefNode(ref);
			return;
		}

		markObjectVisited(currentNode);

		if (currentValue instanceof List) {
			// ArrayList's elementData is marked transient, and others may be as well, so we have to do this ourselves.
			visitList(currentNode);
		} else if (currentValue instanceof Map) {
			// HashMap's table is marked transient, and others may be as well, so we have to do this ourselves.
			visitMap(currentNode);
		} else if (currentValue instanceof ComponentModel) {
			// Special case for ComponentModel, so we can figure out if any fields are overridden
			visitComponentModel(currentNode);
		} else if (currentValue instanceof Field) {
			visitComplexType(currentNode);
			summariseNode(currentNode);
		} else if (currentValue.getClass().isArray()) {
			visitArray(currentNode);
		} else {
			visitComplexType(currentNode);
		}
	}
private void visit ( final ObjectGraphNode currentNode ) { Object currentValue = currentNode . getValue ( ) ; if ( currentValue == null || ( currentValue instanceof java . lang . ref . SoftReference ) || currentNode . isPrimitive ( ) || currentNode . isSimpleType ( ) ) { return ; } if ( isObjectVisited ( currentNode ) ) { ObjectGraphNode ref = visitedNodes . get ( currentValue ) ; currentNode . setRefNode ( ref ) ; return ; } markObjectVisited ( currentNode ) ; if ( currentValue instanceof List ) { visitList ( currentNode ) ; } else if ( currentValue instanceof Map ) { visitMap ( currentNode ) ; } else if ( currentValue instanceof ComponentModel ) { visitComponentModel ( currentNode ) ; } else if ( currentValue instanceof Field ) { visitComplexType ( currentNode ) ; summariseNode ( currentNode ) ; } else if ( currentValue . getClass ( ) . isArray ( ) ) { visitArray ( currentNode ) ; } else { visitComplexType ( currentNode ) ; } }
Implementation of the tree walk.

@param currentNode the node being visited.