void createWrappedStructure ( final WrapperFactory factory ) { HierarchyWrapper currentWrapper = null ; for ( Content child : castToContentList ( elementContent ) ) { Wrapper < ? > wrapper = factory . create ( child ) ; if ( wrapper instanceof SingleNewlineInTextWrapper ) { continue ; } if ( currentWrapper == null ) { currentWrapper = new HierarchyWrapper ( wrapper ) ; children . add ( currentWrapper ) ; } else { currentWrapper . addContent ( wrapper ) ; } if ( currentWrapper . containsElement ( ) ) { currentWrapper . createWrappedStructure ( factory ) ; currentWrapper = null ; } } }
Traverses the initial xml element wrapper and builds hierarchy