|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.mylyn.wikitext.core.parser.DocumentBuilder
org.eclipse.mylyn.wikitext.core.parser.builder.AbstractXmlDocumentBuilder
org.eclipse.mylyn.wikitext.core.parser.builder.DitaBookMapDocumentBuilder
public class DitaBookMapDocumentBuilder
a document builder that can produce OASIS DITA output in the form of a book map and multiple topic output files, one
for each level-1 heading. This document builder differs from others in that it implements Closeable
and
therefore must be closed after use. Also this document builder produces multiple output files.
DocBookDocumentBuilder
,
MarkupToDitaTask
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder |
---|
DocumentBuilder.BlockType, DocumentBuilder.SpanType |
Field Summary |
---|
Fields inherited from class org.eclipse.mylyn.wikitext.core.parser.builder.AbstractXmlDocumentBuilder |
---|
base, baseInHead, writer |
Fields inherited from class org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder |
---|
locator |
Constructor Summary | |
---|---|
DitaBookMapDocumentBuilder(Writer out)
|
|
DitaBookMapDocumentBuilder(XmlStreamWriter writer)
|
Method Summary | |
---|---|
void |
acronym(String text,
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(String text)
Emit the given text as characters where special characters are encoded according to the output format rules. |
void |
charactersUnescaped(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(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(String entity)
An XML entity reference. |
String |
getBookTitle()
the book title as it should appear in the bookmap |
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) |
File |
getTargetFile()
the target output file of the bookmap. |
int |
getTopicBreakLevel()
the heading level at which topics are determined |
String |
getTopicDoctype()
the doctype to be used for topics, or null if the default is to be used |
String |
getTopicFilenameSuffix()
the filename suffix to use when producing topics. |
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,
String url)
Build the image with the given attributes |
void |
imageLink(Attributes linkAttributes,
Attributes imageAttributes,
String href,
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,
String hrefOrHashName,
String text)
Create a hyperlink to the given url. |
void |
setBookTitle(String bookTitle)
the book title as it should appear in the bookmap |
void |
setDoctype(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(File targetFile)
the target output file of the bookmap. |
void |
setTopicBreakLevel(int topicBreakLevel)
the heading level at which topics are determined |
void |
setTopicDoctype(String topicDoctype)
the doctype to be used for topics, or null if the default is to be used |
void |
setTopicFilenameSuffix(String topicFilenameSuffix)
the filename suffix to use when producing topics. |
void |
setTopicFolder(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. |
Methods inherited from class org.eclipse.mylyn.wikitext.core.parser.builder.AbstractXmlDocumentBuilder |
---|
getBase, getElementNestLevel, isBaseInHead, isExternalLink, makeUrlAbsolute, setBase, setBaseInHead |
Methods inherited from class org.eclipse.mylyn.wikitext.core.parser.DocumentBuilder |
---|
annotation, beginLink, endLink, getLocator, imageLink, imageLink, link, setLocator |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DitaBookMapDocumentBuilder(Writer out)
public DitaBookMapDocumentBuilder(XmlStreamWriter writer)
Method Detail |
---|
protected XmlStreamWriter createXmlStreamWriter(Writer out)
createXmlStreamWriter
in class AbstractXmlDocumentBuilder
public String getBookTitle()
public void setBookTitle(String bookTitle)
public String getTopicDoctype()
getDoctype()
public void setTopicDoctype(String topicDoctype)
setDoctype(String)
public String getDoctype()
public void setDoctype(String doctype)
public String getTopicFilenameSuffix()
.dita
.
public void setTopicFilenameSuffix(String topicFilenameSuffix)
.dita
.
public String getTopicFolder()
public void setTopicFolder(String topicFolder)
public File getTargetFile()
public void setTargetFile(File targetFile)
public void acronym(String text, 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(String text)
DocumentBuilder
characters
in class AbstractXmlDocumentBuilder
text
- the text to emit.public void charactersUnescaped(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.endDocument()
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(String entity)
DocumentBuilder
entityReference
in class DocumentBuilder
entity
- the entitypublic void image(Attributes attributes, 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, String href, 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, String hrefOrHashName, 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 IOException
close
in interface Closeable
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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |