public class DitaBookMapDocumentBuilder extends AbstractXmlDocumentBuilder implements java.io.Closeable
Closeable
and
therefore must be closed after use. Also this document builder produces multiple output files.DocBookDocumentBuilder
,
MarkupToDitaTask
DocumentBuilder.BlockType, DocumentBuilder.SpanType
base, baseInHead, writer
locator
Constructor and Description |
---|
DitaBookMapDocumentBuilder(java.io.Writer out) |
DitaBookMapDocumentBuilder(XmlStreamWriter writer) |
Modifier and Type | Method and Description |
---|---|
void |
acronym(java.lang.String text,
java.lang.String definition)
Emit an acronym
|
void |
beginBlock(DocumentBuilder.BlockType type,
Attributes attributes)
Begin a block of the specified type.
|
void |
beginDocument()
Begin a document.
|
void |
beginHeading(int level,
Attributes attributes)
Begin a heading of the specified level (usually 1-6).
|
void |
beginSpan(DocumentBuilder.SpanType type,
Attributes attributes)
Begin a span of the specified type.
|
void |
characters(java.lang.String text)
Emit the given text as characters where special characters are encoded according to the output format rules.
|
void |
charactersUnescaped(java.lang.String literal)
Create unescaped characters, usually with some embedded HTML markup.
|
void |
close()
users of this class must call close when done with it.
|
protected XmlStreamWriter |
createXmlStreamWriter(java.io.Writer out) |
void |
endBlock()
End a block that was
started . |
void |
endDocument()
End a document.
|
void |
endHeading()
End a span that was
started . |
void |
endSpan()
End a span that was
started . |
void |
entityReference(java.lang.String entity)
An XML entity reference.
|
java.lang.String |
getBookTitle()
the book title as it should appear in the bookmap
|
java.lang.String |
getDoctype()
the doctype to be used for the bookmap, or null if the default is to be used
|
OutlineItem |
getOutline()
the outline if available, otherwise null
setOutline(OutlineItem) |
java.io.File |
getTargetFile()
the target output file of the bookmap.
|
int |
getTopicBreakLevel()
the heading level at which topics are determined
|
java.lang.String |
getTopicDoctype()
the doctype to be used for topics, or null if the default is to be used
|
java.lang.String |
getTopicFilenameSuffix()
the filename suffix to use when producing topics.
|
java.lang.String |
getTopicFolder()
the relative folder name of the folder in which topic files should be produced, or null if the files should be
created within the same folder as the bookmap.
|
void |
image(Attributes attributes,
java.lang.String url)
Build the image with the given attributes
|
void |
imageLink(Attributes linkAttributes,
Attributes imageAttributes,
java.lang.String href,
java.lang.String imageUrl)
Create a hyperlink whose visual representation is an image.
|
boolean |
isFormattingDependencies()
Indicate if dependencies should be formatted
|
void |
lineBreak()
Create a line break (eg: br in html).
|
void |
link(Attributes attributes,
java.lang.String hrefOrHashName,
java.lang.String text)
Create a hyperlink to the given url.
|
void |
setBookTitle(java.lang.String bookTitle)
the book title as it should appear in the bookmap
|
void |
setDoctype(java.lang.String doctype)
the doctype to be used for the bookmap, or null if the default is to be used
|
void |
setFormattingDependencies(boolean formattingDependencies)
Indicate if dependencies should be formatted
|
void |
setOutline(OutlineItem outline)
Set the outline of the document being parsed if xref URLs are to be correctly computed.
|
void |
setTargetFile(java.io.File targetFile)
the target output file of the bookmap.
|
void |
setTopicBreakLevel(int topicBreakLevel)
the heading level at which topics are determined
|
void |
setTopicDoctype(java.lang.String topicDoctype)
the doctype to be used for topics, or null if the default is to be used
|
void |
setTopicFilenameSuffix(java.lang.String topicFilenameSuffix)
the filename suffix to use when producing topics.
|
void |
setTopicFolder(java.lang.String topicFolder)
the relative folder name of the folder in which topic files should be produced, or null if the files should be
created within the same folder as the bookmap.
|
flush, getBase, getWriter, isBaseInHead, isExternalLink, makeUrlAbsolute, setBase, setBaseInHead
getLocator, horizontalRule, imageLink, imageLink, link, setLocator
public DitaBookMapDocumentBuilder(java.io.Writer out)
public DitaBookMapDocumentBuilder(XmlStreamWriter writer)
protected XmlStreamWriter createXmlStreamWriter(java.io.Writer out)
createXmlStreamWriter
in class AbstractXmlDocumentBuilder
public java.lang.String getBookTitle()
public void setBookTitle(java.lang.String bookTitle)
public java.lang.String getTopicDoctype()
getDoctype()
public void setTopicDoctype(java.lang.String topicDoctype)
setDoctype(String)
public java.lang.String getDoctype()
public void setDoctype(java.lang.String doctype)
public java.lang.String getTopicFilenameSuffix()
.dita
.public void setTopicFilenameSuffix(java.lang.String topicFilenameSuffix)
.dita
.public java.lang.String getTopicFolder()
public void setTopicFolder(java.lang.String topicFolder)
public java.io.File getTargetFile()
public void setTargetFile(java.io.File targetFile)
public void acronym(java.lang.String text, java.lang.String definition)
DocumentBuilder
acronym
in class DocumentBuilder
text
- the acronym to emitdefinition
- the definition of the acronym, which is typically displayed on mouse hoverpublic void beginBlock(DocumentBuilder.BlockType type, Attributes attributes)
DocumentBuilder
Attributes
class, in which case
the builder may attempt to apply the attributes specified. Builders may choose to ignore attributes, and should
fail silently if the given attributes are not as expected. Each call to this method must be matched by a
corresponding call to DocumentBuilder.endBlock()
.beginBlock
in class DocumentBuilder
attributes
- the attributes to apply to the block. Callers may choose to specify a more specialized set of
attributes by providing a subclass instance.DocumentBuilder.endBlock()
public void beginHeading(int level, Attributes attributes)
DocumentBuilder
DocumentBuilder.endHeading()
.beginHeading
in class DocumentBuilder
level
- the level of the heading, usually 1-6attributes
- the attributes to apply to the headingDocumentBuilder.endHeading()
public void beginSpan(DocumentBuilder.SpanType type, Attributes attributes)
DocumentBuilder
DocumentBuilder.endSpan()
.beginSpan
in class DocumentBuilder
attributes
- the attributes to apply to the spanDocumentBuilder.endSpan()
public void characters(java.lang.String text)
DocumentBuilder
characters
in class AbstractXmlDocumentBuilder
text
- the text to emit.public void charactersUnescaped(java.lang.String literal)
DocumentBuilder
charactersUnescaped
in class DocumentBuilder
literal
- the literal characters to emitpublic void endBlock()
DocumentBuilder
started
.endBlock
in class DocumentBuilder
public void beginDocument()
DocumentBuilder
DocumentBuilder.endDocument()
.beginDocument
in class DocumentBuilder
DocumentBuilder.endDocument()
public void endDocument()
DocumentBuilder
endDocument
in class DocumentBuilder
DocumentBuilder.beginDocument()
,
DocumentBuilder.flush()
public void endHeading()
DocumentBuilder
started
.endHeading
in class DocumentBuilder
DocumentBuilder.beginHeading(int, Attributes)
public void endSpan()
DocumentBuilder
started
.endSpan
in class DocumentBuilder
#beginSpan(org.eclipse.mylyn.wikitext.parser.DocumentBuilder.SpanType, Attributes)
public void entityReference(java.lang.String entity)
DocumentBuilder
entityReference
in class DocumentBuilder
entity
- the entitypublic void image(Attributes attributes, java.lang.String url)
DocumentBuilder
image
in class DocumentBuilder
attributes
- the attributes, which may be an ImageAttributes
.url
- the URL to the image, possibly relativepublic void imageLink(Attributes linkAttributes, Attributes imageAttributes, java.lang.String href, java.lang.String imageUrl)
DocumentBuilder
<a href="..."><img src="..."/></a>
. In this case if the attributes define a css class then
the resulting HTML should look like this: <a href="..."><img src="..." class="..."/></a>
imageLink
in class DocumentBuilder
linkAttributes
- the attributes of the link, which may be LinkAttributes
imageAttributes
- the attributes of the image , which may be ImageAttributes
href
- the url (which may be internal to the page if prefixed with a hash '#')imageUrl
- the url of the image, which may be relativepublic void lineBreak()
DocumentBuilder
lineBreak
in class DocumentBuilder
public void link(Attributes attributes, java.lang.String hrefOrHashName, java.lang.String text)
DocumentBuilder
LinkAttributes
are used, the attributes must not have the
href
attribute set.link
in class DocumentBuilder
attributes
- the attributes of the linkhrefOrHashName
- the url (which may be internal to the page if prefixed with a hash '#')text
- the text of the hyperlinkpublic void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public OutlineItem getOutline()
setOutline(OutlineItem)
public void setOutline(OutlineItem outline)
public int getTopicBreakLevel()
public void setTopicBreakLevel(int topicBreakLevel)
public boolean isFormattingDependencies()
public void setFormattingDependencies(boolean formattingDependencies)
Copyright © 2007, 2013 David Green and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html