/** * Constructor OMStAXWrapper * * @param builder * @param startNode * @param cache */ public DOMStAXWrapper(OMXMLParserWrapper builder, OMElement startNode, boolean cache) { // create a navigator this.navigator = new DOMNavigator(startNode); this.builder = builder; this.rootNode = startNode; if (rootNode != null && rootNode.getParent() != null && rootNode.getParent() instanceof OMDocument) { needToThrowEndDocument = true; } // initaite the next and current nodes // Note - navigator is written in such a way that it first // returns the starting node at the first call to it currentNode = navigator.next(); updateNextNode(); switchingAllowed = !cache; }