Class WikiSyntaxDecorator
java.lang.Object
org.apache.wiki.htmltowiki.syntax.WikiSyntaxDecorator
- All Implemented Interfaces:
SyntaxDecorator
- Direct Known Subclasses:
JSPWikiSyntaxDecorator
,MarkdownSyntaxDecorator
Base Syntax decorator which translates to JSPWiki syntax. Delegates each kind of XHTML element to its specific decorator.
This class is useful when developing a new wiki syntax decorator - just extend from it and provide the implementations of all
the needed Decorators on the SyntaxDecorator.init(PrintWriter, Deque, Deque, WhitespaceTrimWriter, XHtmlToWikiConfig, XHtmlElementToWikiTranslator)
method
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ADecorator
protected BrDecorator
protected XHtmlElementToWikiTranslator
protected CodeDecorator
protected XHtmlToWikiConfig
protected PlainTextCssDecorator
protected PlainTextCssSpecialDecorator
protected DdDecorator
protected DlDecorator
protected DtDecorator
protected PlainTextItalicDecorator
protected FormDecorator
protected H1Decorator
protected H2Decorator
protected H3Decorator
protected H4Decorator
protected HrDecorator
protected ImageDecorator
protected InputDecorator
protected LiDecorator
protected OlDecorator
protected OptionDecorator
protected WhitespaceTrimWriter
protected PDecorator
protected PlainTextDecorator
protected PlainTextMonospaceDecorator
protected SelectDecorator
protected StrikeDecorator
protected PlainTextBoldDecorator
protected SubDecorator
protected SupDecorator
protected TableDecorator
protected TbodyDecorator
protected TdDecorator
protected TextAreaDecorator
protected TextElementDecorator
protected ThDecorator
protected TheadDecorator
protected TrDecorator
protected UlDecorator
protected UnderlineDecorator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Decorates ana
element.void
Decorates ana
element, pointing to a footnote.void
aUndefined
(org.jdom2.Element e) Decorates ana
element to an undefined page.void
br
(org.jdom2.Element base, org.jdom2.Element e) Decorates abr
element.void
code
(org.jdom2.Element e) Decorates acode
ottt
element.void
dd
(org.jdom2.Element e) Decorates add
element.void
dl
(org.jdom2.Element e) Decorates adl
element.void
dt
(org.jdom2.Element e) Decorates adt
element.void
em
(org.jdom2.Element e) Decorates anem
,i
oraddress
element.void
form
(org.jdom2.Element e) Decorates aform
element.void
h1
(org.jdom2.Element e) Decorates anh1
element.void
h2
(org.jdom2.Element e) Decorates anh2
element.void
h3
(org.jdom2.Element e) Decorates anh3
element.void
h4
(org.jdom2.Element e) Decorates anh4
element.void
hr
(org.jdom2.Element e) Decorates anhr
element.void
Decorates an image element.void
img
(org.jdom2.Element e) Decorates an image element.void
input
(org.jdom2.Element e) Decorates aninput
element.void
li
(org.jdom2.Element base, org.jdom2.Element e) Decorates ali
element.void
ol
(org.jdom2.Element e) Decorates anol
element.void
option
(org.jdom2.Element base, org.jdom2.Element e) Decorates anoption
element.void
p
(org.jdom2.Element e) Decorates ap
element.void
Decorates a text paragraph.void
pre
(org.jdom2.Element e) Decorates apre
element.void
select
(org.jdom2.Element e) Decorates aselect
element.void
strike
(org.jdom2.Element e) Decorates astrike
element.void
strong
(org.jdom2.Element e) Decorates astrong
orb
element.void
sub
(org.jdom2.Element e) Decorates asub
element.void
sup
(org.jdom2.Element e) Decorates ansup
element.void
table
(org.jdom2.Element e) Decorates atable
element.void
tbody
(org.jdom2.Element e) Decorates atbody
element.void
td
(org.jdom2.Element e) Decorates antd
element.void
text
(org.jdom2.Text element) Decorates a text element.void
textarea
(org.jdom2.Element e) Decorates atextarea
element.void
th
(org.jdom2.Element e) Decorates ath
element.void
thead
(org.jdom2.Element e) Decorates athead
element.void
tr
(org.jdom2.Element e) Decorates atr
element.void
ul
(org.jdom2.Element e) Decorates anul
element.void
underline
(org.jdom2.Element e) Decorates anunderline
element.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.wiki.htmltowiki.SyntaxDecorator
init
-
Field Details
-
a
-
br
-
code
-
dd
-
dl
-
dt
-
form
-
hr
-
h1
-
h2
-
h3
-
h4
-
img
-
input
-
li
-
ol
-
option
-
p
-
plainText
-
strong
-
css
-
cssStyle
-
em
-
pre
-
select
-
strike
-
sub
-
sup
-
table
-
tbody
-
td
-
textarea
-
textElement
-
th
-
thead
-
tr
-
ul
-
underline
-
outTrimmer
-
chain
-
config
-
-
Constructor Details
-
WikiSyntaxDecorator
public WikiSyntaxDecorator()
-
-
Method Details
-
a
Decorates ana
element.- Specified by:
a
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.ref
- actual link.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
aFootnote
Decorates ana
element, pointing to a footnote.- Specified by:
aFootnote
in interfaceSyntaxDecorator
- Parameters:
text
- text link of the footnote.ref
- link to footnote.
-
aUndefined
Decorates ana
element to an undefined page.- Specified by:
aUndefined
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
br
Decorates abr
element.- Specified by:
br
in interfaceSyntaxDecorator
- Parameters:
base
- parent of the XHTML element being translated.e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
code
Decorates acode
ottt
element.- Specified by:
code
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
dd
Decorates add
element.- Specified by:
dd
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
dl
Decorates adl
element.- Specified by:
dl
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
dt
Decorates adt
element.- Specified by:
dt
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
em
Decorates anem
,i
oraddress
element.- Specified by:
em
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
form
Decorates aform
element.- Specified by:
form
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
hr
Decorates anhr
element.- Specified by:
hr
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
h1
Decorates anh1
element.- Specified by:
h1
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
h2
Decorates anh2
element.- Specified by:
h2
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
h3
Decorates anh3
element.- Specified by:
h3
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
h4
Decorates anh4
element.- Specified by:
h4
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
image
Decorates an image element. This is a terminal operation, that is, chain is not expected to be called by this method.- Specified by:
image
in interfaceSyntaxDecorator
- Parameters:
src
- image sourceimageAttrs
- image attributes
-
img
Decorates an image element. This is a terminal operation, that is, chain is not expected to be called by this method.- Specified by:
img
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.
-
input
Decorates aninput
element.- Specified by:
input
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
li
Decorates ali
element.- Specified by:
li
in interfaceSyntaxDecorator
- Parameters:
base
- parent of the XHTML element being translated.e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
ol
Decorates anol
element.- Specified by:
ol
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
option
Decorates anoption
element.- Specified by:
option
in interfaceSyntaxDecorator
- Parameters:
base
- parent of the XHTML element being translated.e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
p
Decorates ap
element.- Specified by:
p
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
paragraph
public void paragraph(XHtmlElementToWikiTranslator.ElementDecoratorData dto) throws org.jdom2.JDOMException Decorates a text paragraph.- Specified by:
paragraph
in interfaceSyntaxDecorator
- Parameters:
dto
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
pre
Decorates apre
element.- Specified by:
pre
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
strong
Decorates astrong
orb
element.- Specified by:
strong
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
table
Decorates atable
element.- Specified by:
table
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
tbody
Decorates atbody
element.- Specified by:
tbody
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
td
Decorates antd
element.- Specified by:
td
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
text
Decorates a text element. This is a terminal operation, that is, chain is not expected to be called by this method.- Specified by:
text
in interfaceSyntaxDecorator
- Parameters:
element
- XHTML element being translated.
-
textarea
Decorates atextarea
element.- Specified by:
textarea
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
th
Decorates ath
element.- Specified by:
th
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
thead
Decorates athead
element.- Specified by:
thead
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
tr
Decorates atr
element.- Specified by:
tr
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
select
Decorates aselect
element.- Specified by:
select
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
strike
Decorates astrike
element.- Specified by:
strike
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
sub
Decorates asub
element.- Specified by:
sub
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
sup
Decorates ansup
element.- Specified by:
sup
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
ul
Decorates anul
element.- Specified by:
ul
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-
underline
Decorates anunderline
element.- Specified by:
underline
in interfaceSyntaxDecorator
- Parameters:
e
- XHTML element being translated.- Throws:
org.jdom2.JDOMException
- if an error has ocurred parsing the xhtml chain.
-