public class WriteOdt
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
WriteOdt.Cfg |
static class |
WriteOdt.CmdArgs |
Modifier and Type | Field and Description |
---|---|
(package private) WriteOdt.CmdArgs |
args |
(package private) boolean |
bColumnBreakBefore
True then a "'''" was seen before.
|
(package private) boolean |
bInsideCode |
(package private) boolean |
bInsideColumn2 |
(package private) boolean |
bInsideListItem
true then a <text:list-item... is opened in the moment.
|
(package private) boolean |
bPageBreakBefore
True then a "'''" was seen before.
|
(package private) boolean |
bParagrFirstline
true only immediately after set <text:p
|
(package private) WriteOdt.Cfg |
cfg |
(package private) java.util.Map<java.lang.String,java.lang.String> |
idxBookmark |
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
idxHtmlFilesAnchors |
private java.lang.String |
lastAnchorReplaced
The last anchor which is replaced for operation arguments.
|
LogMessage |
log |
(package private) int |
nList
>=1 then the deepness of nesting list nodes.
|
(package private) int |
nrFrameImgName |
(package private) int |
nrSectionName |
(package private) int |
nrTableName |
(package private) int |
nSection
>=1 then the deepness of nesting section nodes.
|
(package private) java.io.BufferedReader |
rAdoc |
(package private) java.lang.StringBuilder |
sbo |
(package private) static java.lang.String[][] |
sCheckReplace |
(package private) static java.lang.String[] |
sCheckTextReplVmu
Builds the search Strings for replacing from VMU to character in
sTextReplace [0]. |
(package private) java.lang.String |
sCodeStyle
If set (not null) then the next lines till "----" should be written as <text:p... with this style.
|
(package private) java.lang.String |
sLabel
Stores a [#label] for the next header or paragraph.
|
(package private) java.lang.String |
sLineNext
Last read line from aDoc.
|
private static java.lang.String[] |
specificLineStarts |
(package private) java.lang.String |
sRefBookmark
It is set if a ref to bookmark was created.
|
(package private) java.lang.String |
sStyleParagr
If not null then a
[.style] was read. |
(package private) static java.lang.String[][] |
sTextCtrlCommon |
(package private) static java.lang.String[] |
sTextCtrlCommonSearchAsciidoc
Contains the Strings to search in Markup source to replace with function or style..
|
(package private) static java.lang.String[] |
sTextCtrlCommonSearchMu
Contains the Strings to search in Markup source to replace with function or style..
|
(package private) static java.lang.String[][] |
sTextReplace
https://op.europa.eu/de/web/eu-vocabularies/formex/physical-specifications/character-encoding/quotation-marks
|
(package private) static java.lang.String[][] |
sTextReplaceAsciidoc
This Strings are replaced from Asciidoc to LibreOffice.
|
(package private) static java.lang.String |
sTextReplaceChars
Single characters to replace with
sTextReplace proper for StringFunctions# |
(package private) static java.lang.String[] |
sWwwLink |
private java.io.Writer |
wrRep |
(package private) XmlCfg |
xmlCfgOdt |
(package private) XmlSequWriter |
xmlWr |
(package private) int |
XXXnParagr
>=1 then the deepness of nesting paragraph nodes.
|
Modifier | Constructor and Description |
---|---|
protected |
WriteOdt(WriteOdt.CmdArgs args) |
Modifier and Type | Method and Description |
---|---|
static int |
amain(WriteOdt.CmdArgs args)
main for this class, with given prepared arguments
Does not catch unexpected exceptions and does not System.exit(...), use it to execute in a Java environment.
|
private java.io.File |
checkAndChangeFileImage(java.lang.String[] sLinkUse,
java.io.File dirOdt,
java.lang.String sLink,
java.lang.String sTitle) |
private java.lang.String |
checkParseCommentLine(java.lang.String line) |
private java.lang.String |
checkReplaceLinkOperationLabel(java.lang.String sRef) |
private java.util.Map<java.lang.String,java.lang.String> |
createHtmlAnchorOperations(java.lang.String sHtml) |
private void |
execute() |
private void |
finitList(int nList) |
private void |
finitSection(int toLevel) |
private boolean |
isEmptyLine(java.lang.String line,
int fromPos) |
static void |
main(java.lang.String[] sArgs)
main for UFBglConv, invoked from cmd line.
|
protected java.lang.String |
parseAdocLine(java.lang.String line)
Parse a new line for paragraph etc, not the continued lines from a paragraph.
|
private java.lang.String |
parseAdocM(java.lang.String line)
Parse a new line for paragraph etc, not the continued lines from a paragraph.
|
private void |
parseAdocWriteOdt() |
private java.lang.String |
parseImage(java.lang.String args,
boolean bOnlyImage)
Writes an image with given arguments from the span <:args
|
private java.lang.String |
parseList(java.lang.String line) |
private java.lang.String |
parseTableRow(java.lang.String line) |
private java.lang.String |
parseWriteCodeBlock(java.lang.String sStartLine)
Writes a block as code, insert here between all lines in Asciidoc
a <text:line-break/>.
|
private java.lang.String |
parseWriteParagr(java.lang.String line) |
private java.lang.String |
parseWriteParagrStyleLabel(java.lang.String line) |
private java.lang.String |
parseWriteSection(java.lang.String line) |
private java.lang.String |
parseWriteTable(java.lang.String line) |
private java.lang.String |
parseWriteText(java.lang.CharSequence cline,
boolean bIndentSpaces)
Analyzes the given line where interpretation are necessrary, and writes it with <:text:span... > in the given line,
writes the text with
writeText(String, boolean) outside interpreations stuff. |
private java.lang.StringBuilder |
readAllTextLinesOfParagraph(java.lang.String sLineStart)
Reads all text lines till empty line or till specific such as "* " for a list.
|
private java.lang.String |
searchForReplaceLinkOperationLabel(java.lang.String sRef,
int posFileEnd,
java.lang.String text,
int posNameEnd) |
static int |
smain(java.lang.String[] sArgs,
java.lang.Appendable logHelp,
java.lang.Appendable logError)
main gets the arguments as String,
but does not catch unexpected exceptions and does not System.exit(...), use it to execute in a Java environment.
|
private java.lang.String |
writeHeaderLine(java.lang.String lineArg) |
private void |
writeInternalRef(java.lang.String refArg) |
private void |
writeInternalRefPage() |
private void |
writeLink(java.lang.String sLink) |
private java.lang.String |
writeSectionEnd(java.lang.String line) |
private void |
writeStyleSections() |
private java.lang.String |
writeTableOfContents(java.lang.String line) |
private java.lang.String |
writeText(java.lang.String txtArg,
boolean bNewline)
Writes the pure text to XML, whereby spaces are replaced by <text:s...>.
|
private void |
wrRep(java.lang.CharSequence line) |
private void |
XXXfinitParagr() |
private java.lang.String |
XXXwriteCodeLine(java.lang.String line) |
final WriteOdt.CmdArgs args
final WriteOdt.Cfg cfg
public final LogMessage log
final XmlCfg xmlCfgOdt
java.io.BufferedReader rAdoc
java.lang.String sLineNext
int XXXnParagr
java.lang.String sStyleParagr
[.style] was read.
Valid for the next paragraph.
boolean bParagrFirstline
int nSection
int nList
boolean bInsideListItem
boolean bPageBreakBefore
boolean bColumnBreakBefore
boolean bInsideColumn2
int nrSectionName
int nrTableName
int nrFrameImgName
java.util.Map<java.lang.String,java.lang.String> idxBookmark
java.lang.String sCodeStyle
boolean bInsideCode
java.lang.String sRefBookmark
java.lang.String sLabel
final java.lang.StringBuilder sbo
private java.io.Writer wrRep
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> idxHtmlFilesAnchors
private java.lang.String lastAnchorReplaced
final XmlSequWriter xmlWr
private static java.lang.String[] specificLineStarts
static java.lang.String[][] sTextReplace
static java.lang.String sTextReplaceChars
sTextReplace
proper for StringFunctions#static java.lang.String[][] sTextReplaceAsciidoc
static java.lang.String[][] sCheckReplace
static java.lang.String[] sCheckTextReplVmu
sTextReplace
[0].static java.lang.String[][] sTextCtrlCommon
static java.lang.String[] sTextCtrlCommonSearchMu
static java.lang.String[] sTextCtrlCommonSearchAsciidoc
static java.lang.String[] sWwwLink
protected WriteOdt(WriteOdt.CmdArgs args)
public static int amain(WriteOdt.CmdArgs args) throws java.io.IOException
args
- prepared cmd line argumentsjava.io.IOException
java.lang.Exception
- if unexpected.public static int smain(java.lang.String[] sArgs, java.lang.Appendable logHelp, java.lang.Appendable logError) throws java.io.IOException
sArgs
- java.io.IOException
java.lang.Exception
- if unexpected.public static void main(java.lang.String[] sArgs)
sArgs
- private void wrRep(java.lang.CharSequence line) throws java.io.IOException
java.io.IOException
private void execute() throws java.io.IOException
java.io.IOException
private void writeStyleSections() throws java.io.IOException
java.io.IOException
private void parseAdocWriteOdt() throws java.io.IOException
java.io.IOException
protected java.lang.String parseAdocLine(java.lang.String line) throws java.io.IOException
line
- found linejava.io.IOException
private java.lang.String parseAdocM(java.lang.String line) throws java.io.IOException
line
- found linejava.io.IOException
private boolean isEmptyLine(java.lang.String line, int fromPos)
private java.lang.String writeHeaderLine(java.lang.String lineArg) throws java.io.IOException
java.io.IOException
private java.lang.String checkParseCommentLine(java.lang.String line) throws java.io.IOException
java.io.IOException
private java.lang.String parseWriteSection(java.lang.String line) throws java.io.IOException
java.io.IOException
private java.lang.String writeSectionEnd(java.lang.String line) throws java.io.IOException
java.io.IOException
private java.lang.String parseWriteParagrStyleLabel(java.lang.String line) throws java.io.IOException
java.io.IOException
private java.lang.String parseWriteParagr(java.lang.String line) throws java.io.IOException
java.io.IOException
private java.lang.String parseList(java.lang.String line) throws java.io.IOException
java.io.IOException
private java.lang.StringBuilder readAllTextLinesOfParagraph(java.lang.String sLineStart) throws java.io.IOException
sLineStart
- The first line.sLineNext
for using for the next paragraph, especially a list.java.io.IOException
private java.lang.String parseWriteText(java.lang.CharSequence cline, boolean bIndentSpaces) throws java.io.IOException
writeText(String, boolean)
outside interpreations stuff.
Which is regarded: see sTextCtrlCommon
, #sTextCtrlItalicBold
, #sTextCtrlStyleForItalicBold
.
The WriteOdt.Cfg.useItalicBold
decides whether __textInItalic__
etc. is outputted as indirect style italic
or as direct style "Quotation". Both is possible.line
- java.io.IOException
private void writeInternalRef(java.lang.String refArg) throws java.io.IOException
java.io.IOException
private void writeInternalRefPage() throws java.io.IOException
java.io.IOException
private void writeLink(java.lang.String sLink) throws java.io.IOException
java.io.IOException
private java.lang.String searchForReplaceLinkOperationLabel(java.lang.String sRef, int posFileEnd, java.lang.String text, int posNameEnd)
private java.util.Map<java.lang.String,java.lang.String> createHtmlAnchorOperations(java.lang.String sHtml) throws java.io.IOException
java.io.IOException
private java.lang.String checkReplaceLinkOperationLabel(java.lang.String sRef)
private java.lang.String writeText(java.lang.String txtArg, boolean bNewline) throws java.io.IOException
#parseWriteText(String)
txtArg
- bNewline
- java.io.IOException
private java.lang.String XXXwriteCodeLine(java.lang.String line) throws java.io.IOException
java.io.IOException
private java.lang.String parseWriteCodeBlock(java.lang.String sStartLine) throws java.io.IOException
#parseWriteText(String)
.sStartLine
- first line of code block, either "----" or with first a space.java.io.IOException
private java.lang.String writeTableOfContents(java.lang.String line) throws java.io.IOException
java.io.IOException
private void XXXfinitParagr() throws java.io.IOException
java.io.IOException
private void finitList(int nList) throws java.io.IOException
java.io.IOException
private void finitSection(int toLevel) throws java.io.IOException
java.io.IOException
private java.lang.String parseWriteTable(java.lang.String line) throws java.io.IOException
java.io.IOException
private java.lang.String parseTableRow(java.lang.String line) throws java.io.IOException
java.io.IOException
private java.lang.String parseImage(java.lang.String args, boolean bOnlyImage) throws java.io.IOException
args
- between <:args.>bOnlyImage
- true then the paragraph contains only the image.
Note in LibreOffice an image is always embedded in a paragraph.java.io.IOException
private java.io.File checkAndChangeFileImage(java.lang.String[] sLinkUse, java.io.File dirOdt, java.lang.String sLink, java.lang.String sTitle)