/** Prepare to end an element, by writing a new line and indentation. */ protected void beforeEndElement() { final Set<StackState> state = scopeState.getFirst(); // but not data if (depth > 0 && state.contains(StackState.WROTE_MARKUP) && !state.contains(StackState.WROTE_DATA)) { final String indent = this.getIndent(depth - 1, indentSize); final Characters indentEvent = xmlEventFactory.createCharacters(indent); try { wrappedWriter.add(indentEvent); } catch (XMLStreamException e) { // Ignore exceptions caused by indentation } } }
/** Prepare to end an element, by writing a new line and indentation. */ protected void beforeEndElement() { final Set<StackState> state = scopeState.getFirst(); // but not data if (depth > 0 && state.contains(StackState.WROTE_MARKUP) && !state.contains(StackState.WROTE_DATA)) { final String indent = this.getIndent(depth - 1, indentSize); final Characters indentEvent = xmlEventFactory.createCharacters(indent); try { wrappedWriter.add(indentEvent); } catch (XMLStreamException e) { // Ignore exceptions caused by indentation } } }
/** Prepare to write markup, by writing a new line and indentation. */ protected void beforeMarkup() { final Set<StackState> state = scopeState.getFirst(); if (!state.contains(StackState.WROTE_DATA) && (depth > 0 || !state.isEmpty())) { final String indent = getIndent(this.depth, this.indentSize); final Characters indentEvent = xmlEventFactory.createCharacters(indent); try { wrappedWriter.add(indentEvent); } catch (XMLStreamException e) { // Ignore exceptions caused by indentation } afterMarkup(); // indentation was written } }
/** Prepare to write markup, by writing a new line and indentation. */ protected void beforeMarkup() { final Set<StackState> state = scopeState.getFirst(); if (!state.contains(StackState.WROTE_DATA) && (depth > 0 || !state.isEmpty())) { final String indent = getIndent(this.depth, this.indentSize); final Characters indentEvent = xmlEventFactory.createCharacters(indent); try { wrappedWriter.add(indentEvent); } catch (XMLStreamException e) { // Ignore exceptions caused by indentation } afterMarkup(); // indentation was written } }