|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.io.Reader
|
+--com.ecyrd.jspwiki.TranslatorReader
Handles conversion from Wiki format into fully featured HTML. This is where all the magic happens. It is CRITICAL that this class is tested, or all Wikis might die horribly.
The output of the HTML has not yet been validated against the HTML DTD. However, it is very simple.
| Field Summary | |
static int |
ATTACHMENT
|
static java.lang.String |
DEFAULT_INLINEPATTERN
The default inlining pattern. |
static int |
EDIT
|
static java.lang.String |
PROP_ALLOWHTML
If set to "true", allows using raw HTML within Wiki text. |
static java.lang.String |
PROP_CAMELCASELINKS
If true, consider CamelCase hyperlinks as well. |
static java.lang.String |
PROP_INLINEIMAGEPTRN
This property defines the inline image pattern. |
static java.lang.String |
PROP_PLAINURIS
If true, all hyperlinks are translated as well, regardless whether they are surrounded by brackets. |
static java.lang.String |
PROP_USEOUTLINKIMAGE
If true, all outward links (external links) have a small link image appended. |
static int |
READ
|
| Fields inherited from class java.io.Reader |
lock |
| Constructor Summary | |
TranslatorReader(WikiContext context,
java.io.Reader in)
|
|
| Method Summary | |
void |
addAttachmentLinkHook(StringTransmutator mutator)
Adds a hook for processing attachment links. |
void |
addExternalLinkHook(StringTransmutator mutator)
Adds a hook for processing external links. |
void |
addLinkTransmutator(StringTransmutator mutator)
Adds a hook for processing link texts. |
void |
addLocalLinkHook(StringTransmutator mutator)
Adds a hook for processing local links. |
static java.lang.String |
cleanLink(java.lang.String link)
Cleans a Wiki name. |
void |
close()
|
protected static java.util.Collection |
getImagePatterns(WikiEngine engine)
Figure out which image suffixes should be inlined. |
java.lang.String |
makeLink(int type,
java.lang.String link,
java.lang.String text)
Write a HTMLized link depending on its type. |
int |
read()
|
int |
read(char[] buf,
int off,
int len)
|
boolean |
ready()
|
| Methods inherited from class java.io.Reader |
mark, markSupported, read, reset, skip |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int READ
public static final int EDIT
public static final int ATTACHMENT
public static final java.lang.String PROP_INLINEIMAGEPTRN
public static final java.lang.String PROP_CAMELCASELINKS
public static final java.lang.String PROP_PLAINURIS
public static final java.lang.String PROP_USEOUTLINKIMAGE
public static final java.lang.String PROP_ALLOWHTML
public static final java.lang.String DEFAULT_INLINEPATTERN
| Constructor Detail |
public TranslatorReader(WikiContext context,
java.io.Reader in)
| Method Detail |
public void addLinkTransmutator(StringTransmutator mutator)
mutator - The hook to call. Null is safe.public void addLocalLinkHook(StringTransmutator mutator)
mutator - The hook to call. Null is safe.public void addExternalLinkHook(StringTransmutator mutator)
mutator - The hook to call. Null is safe.public void addAttachmentLinkHook(StringTransmutator mutator)
mutator - The hook to call. Null is safe.protected static java.util.Collection getImagePatterns(WikiEngine engine)
public java.lang.String makeLink(int type,
java.lang.String link,
java.lang.String text)
type - Type of the link.link - The actual link.text - The user-visible text for the link.public static java.lang.String cleanLink(java.lang.String link)
[ This is a link ] -> ThisIsALink
link - Link to be cleared. Null is safe, and causes this to return null.
public int read()
throws java.io.IOException
read in class java.io.Readerjava.io.IOException
public int read(char[] buf,
int off,
int len)
throws java.io.IOException
read in class java.io.Readerjava.io.IOException
public boolean ready()
throws java.io.IOException
ready in class java.io.Readerjava.io.IOExceptionpublic void close()
close in class java.io.Reader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||