@Override public void close() throws IOException { emitDelimiter(trailingNewlineCount); super.close(); } }
@Override public void close() throws IOException { emitContent(suffix); super.close(); } }
@Override public void write(String s) throws IOException { hasContent = true; emitContent(normalizeWhitespace(s)); }
private void maybeInsertAdjacentWhitespace(int c) throws IOException { if (adjacentSeparatorRequired) { if (!isSeparator(c)) { char lastChar = getLastChar(); if (lastChar != 0 && !isSeparator(lastChar)) { writer.write(' '); } } adjacentSeparatorRequired = false; } }
private void emitDelimiter(int newlineCount) throws IOException { if (getLastChar() != 0) { int delimiterSize = newlineCount - getTrailingNewlineCount(); for (int x = delimiterSize; x > 0; --x) { emitContent('\n'); } } }
private int doubleNewlineDelimiterCount() { if (currentBlock != null) { BlockType currentBlockType = currentBlock.getBlockType(); if (currentBlockType == BlockType.LIST_ITEM || currentBlockType == BlockType.DEFINITION_ITEM || currentBlockType == BlockType.DEFINITION_TERM || currentBlockType == BlockType.BULLETED_LIST || currentBlockType == BlockType.NUMERIC_LIST || currentBlockType == BlockType.DEFINITION_LIST) { return 1; } } return 2; }
@Override protected XmlStreamWriter createXmlStreamWriter(Writer out) { XmlStreamWriter writer = super.createXmlStreamWriter(out); return wrapStreamWriter(writer); }
@Override public void characters(String text) { if (mapEntryOpen) { titleText += text; } getCurrentTopic().characters(text); }
@Override public void imageLink(Attributes linkAttributes, Attributes imageAttributes, String href, String imageUrl) { getCurrentTopic().imageLink(linkAttributes, imageAttributes, href, imageUrl); }
@Override public void characters(String text) { ensureOpenTopic(); super.characters(text); }
@Override public void open() throws IOException { super.open(); emitDelimiter(precedingNewlineCount); }
@Override public void characters(String text) { ensureBlockElementsOpen(); super.characters(text); }
@Override public void beginBlock(BlockType type, Attributes attributes) { getCurrentTopic().beginBlock(type, attributes); }
@Override public void charactersUnescaped(String literal) { getCurrentTopic().charactersUnescaped(literal); }
@Override protected XmlStreamWriter createXmlStreamWriter(Writer out) { return super.createFormattingXmlStreamWriter(out); } };
@Override public void endSpan() { getCurrentTopic().endSpan(); }
/** * Creates paragraph blocks in cases where content is emitted but no block is currently open. Subclasses may * override to alter the default paragraph block implementation. */ protected Block createImplicitParagraphBlock() { return new ImplicitParagraphBlock(); }
@Override public void setLocator(Locator locator) { if (out != null) { out.setLocator(locator); } }
@Override public void close() throws IOException { if (hasContent) { emitContent("\n\n"); //$NON-NLS-1$ } super.close(); }
@Override public void write(int c) throws IOException { hasContent = true; emitContent(normalizeWhitespace(c)); }