Class WikiSyntaxDecorator
- java.lang.Object
-
- org.apache.wiki.htmltowiki.syntax.WikiSyntaxDecorator
-
- All Implemented Interfaces:
SyntaxDecorator
- Direct Known Subclasses:
JSPWikiSyntaxDecorator,MarkdownSyntaxDecorator
public abstract class WikiSyntaxDecorator extends java.lang.Object implements SyntaxDecorator
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
-
Constructor Summary
Constructors Constructor Description WikiSyntaxDecorator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voida(org.jdom2.Element e, java.lang.String ref)Decorates anaelement.voidaFootnote(java.lang.String text, java.lang.String ref)Decorates anaelement, pointing to a footnote.voidaUndefined(org.jdom2.Element e)Decorates anaelement to an undefined page.voidbr(org.jdom2.Element base, org.jdom2.Element e)Decorates abrelement.voidcode(org.jdom2.Element e)Decorates acodeotttelement.voiddd(org.jdom2.Element e)Decorates addelement.voiddl(org.jdom2.Element e)Decorates adlelement.voiddt(org.jdom2.Element e)Decorates adtelement.voidem(org.jdom2.Element e)Decorates anem,ioraddresselement.voidform(org.jdom2.Element e)Decorates aformelement.voidh1(org.jdom2.Element e)Decorates anh1element.voidh2(org.jdom2.Element e)Decorates anh2element.voidh3(org.jdom2.Element e)Decorates anh3element.voidh4(org.jdom2.Element e)Decorates anh4element.voidhr(org.jdom2.Element e)Decorates anhrelement.voidimage(java.lang.String src, java.util.Map<java.lang.String,java.lang.Object> imageAttrs)Decorates an image element.voidimg(org.jdom2.Element e)Decorates an image element.voidinput(org.jdom2.Element e)Decorates aninputelement.voidli(org.jdom2.Element base, org.jdom2.Element e)Decorates alielement.voidol(org.jdom2.Element e)Decorates anolelement.voidoption(org.jdom2.Element base, org.jdom2.Element e)Decorates anoptionelement.voidp(org.jdom2.Element e)Decorates apelement.voidparagraph(XHtmlElementToWikiTranslator.ElementDecoratorData dto)Decorates a text paragraph.voidpre(org.jdom2.Element e)Decorates apreelement.voidselect(org.jdom2.Element e)Decorates aselectelement.voidstrike(org.jdom2.Element e)Decorates astrikeelement.voidstrong(org.jdom2.Element e)Decorates astrongorbelement.voidsub(org.jdom2.Element e)Decorates asubelement.voidsup(org.jdom2.Element e)Decorates ansupelement.voidtable(org.jdom2.Element e)Decorates atableelement.voidtbody(org.jdom2.Element e)Decorates atbodyelement.voidtd(org.jdom2.Element e)Decorates antdelement.voidtext(org.jdom2.Text element)Decorates a text element.voidtextarea(org.jdom2.Element e)Decorates atextareaelement.voidth(org.jdom2.Element e)Decorates athelement.voidthead(org.jdom2.Element e)Decorates atheadelement.voidtr(org.jdom2.Element e)Decorates atrelement.voidul(org.jdom2.Element e)Decorates anulelement.voidunderline(org.jdom2.Element e)Decorates anunderlineelement.-
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 Detail
-
a
protected ADecorator a
-
br
protected BrDecorator br
-
code
protected CodeDecorator code
-
dd
protected DdDecorator dd
-
dl
protected DlDecorator dl
-
dt
protected DtDecorator dt
-
form
protected FormDecorator form
-
hr
protected HrDecorator hr
-
h1
protected H1Decorator h1
-
h2
protected H2Decorator h2
-
h3
protected H3Decorator h3
-
h4
protected H4Decorator h4
-
img
protected ImageDecorator img
-
input
protected InputDecorator input
-
li
protected LiDecorator li
-
ol
protected OlDecorator ol
-
option
protected OptionDecorator option
-
p
protected PDecorator p
-
plainText
protected PlainTextDecorator plainText
-
strong
protected PlainTextBoldDecorator strong
-
css
protected PlainTextCssDecorator css
-
cssStyle
protected PlainTextCssSpecialDecorator cssStyle
-
em
protected PlainTextItalicDecorator em
-
pre
protected PlainTextMonospaceDecorator pre
-
select
protected SelectDecorator select
-
strike
protected StrikeDecorator strike
-
sub
protected SubDecorator sub
-
sup
protected SupDecorator sup
-
table
protected TableDecorator table
-
tbody
protected TbodyDecorator tbody
-
td
protected TdDecorator td
-
textarea
protected TextAreaDecorator textarea
-
textElement
protected TextElementDecorator textElement
-
th
protected ThDecorator th
-
thead
protected TheadDecorator thead
-
tr
protected TrDecorator tr
-
ul
protected UlDecorator ul
-
underline
protected UnderlineDecorator underline
-
outTrimmer
protected WhitespaceTrimWriter outTrimmer
-
chain
protected XHtmlElementToWikiTranslator chain
-
config
protected XHtmlToWikiConfig config
-
-
Constructor Detail
-
WikiSyntaxDecorator
public WikiSyntaxDecorator()
-
-
Method Detail
-
a
public void a(org.jdom2.Element e, java.lang.String ref) throws org.jdom2.JDOMException
Decorates anaelement.- Specified by:
ain interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.ref- actual link.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
aFootnote
public void aFootnote(java.lang.String text, java.lang.String ref)
Decorates anaelement, pointing to a footnote.- Specified by:
aFootnotein interfaceSyntaxDecorator- Parameters:
text- text link of the footnote.ref- link to footnote.
-
aUndefined
public void aUndefined(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates anaelement to an undefined page.- Specified by:
aUndefinedin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
br
public void br(org.jdom2.Element base, org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates abrelement.- Specified by:
brin 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
public void code(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates acodeotttelement.- Specified by:
codein interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
dd
public void dd(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates addelement.- Specified by:
ddin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
dl
public void dl(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates adlelement.- Specified by:
dlin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
dt
public void dt(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates adtelement.- Specified by:
dtin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
em
public void em(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates anem,ioraddresselement.- Specified by:
emin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
form
public void form(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates aformelement.- Specified by:
formin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
hr
public void hr(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates anhrelement.- Specified by:
hrin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
h1
public void h1(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates anh1element.- Specified by:
h1in interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
h2
public void h2(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates anh2element.- Specified by:
h2in interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
h3
public void h3(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates anh3element.- Specified by:
h3in interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
h4
public void h4(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates anh4element.- Specified by:
h4in interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
image
public void image(java.lang.String src, java.util.Map<java.lang.String,java.lang.Object> imageAttrs)
Decorates an image element. This is a terminal operation, that is, chain is not expected to be called by this method.- Specified by:
imagein interfaceSyntaxDecorator- Parameters:
src- image sourceimageAttrs- image attributes
-
img
public void img(org.jdom2.Element e)
Decorates an image element. This is a terminal operation, that is, chain is not expected to be called by this method.- Specified by:
imgin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.
-
input
public void input(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates aninputelement.- Specified by:
inputin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
li
public void li(org.jdom2.Element base, org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates alielement.- Specified by:
liin 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
public void ol(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates anolelement.- Specified by:
olin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
option
public void option(org.jdom2.Element base, org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates anoptionelement.- Specified by:
optionin 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
public void p(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates apelement.- Specified by:
pin 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:
paragraphin interfaceSyntaxDecorator- Parameters:
dto- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
pre
public void pre(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates apreelement.- Specified by:
prein interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
strong
public void strong(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates astrongorbelement.- Specified by:
strongin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
table
public void table(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates atableelement.- Specified by:
tablein interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
tbody
public void tbody(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates atbodyelement.- Specified by:
tbodyin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
td
public void td(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates antdelement.- Specified by:
tdin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
text
public void text(org.jdom2.Text element)
Decorates a text element. This is a terminal operation, that is, chain is not expected to be called by this method.- Specified by:
textin interfaceSyntaxDecorator- Parameters:
element- XHTML element being translated.
-
textarea
public void textarea(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates atextareaelement.- Specified by:
textareain interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
th
public void th(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates athelement.- Specified by:
thin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
thead
public void thead(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates atheadelement.- Specified by:
theadin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
tr
public void tr(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates atrelement.- Specified by:
trin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
select
public void select(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates aselectelement.- Specified by:
selectin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
strike
public void strike(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates astrikeelement.- Specified by:
strikein interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
sub
public void sub(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates asubelement.- Specified by:
subin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
sup
public void sup(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates ansupelement.- Specified by:
supin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
ul
public void ul(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates anulelement.- Specified by:
ulin interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
underline
public void underline(org.jdom2.Element e) throws org.jdom2.JDOMException
Decorates anunderlineelement.- Specified by:
underlinein interfaceSyntaxDecorator- Parameters:
e- XHTML element being translated.- Throws:
org.jdom2.JDOMException- if an error has ocurred parsing the xhtml chain.
-
-