|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Reader
com.ecyrd.jspwiki.TranslatorReader
public class 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.
This class is officially deprecated in 2.3, and will be replaced with a dummy class later on. Please see MarkupParser.
Field Summary | |
---|---|
static String |
DEFAULT_INLINEPATTERN
Deprecated. The default inlining pattern. |
static String |
PROP_ALLOWHTML
Deprecated. If set to "true", allows using raw HTML within Wiki text. |
static String |
PROP_CAMELCASELINKS
Deprecated. If true, consider CamelCase hyperlinks as well. |
static String |
PROP_INLINEIMAGEPTRN
Deprecated. This property defines the inline image pattern. |
static String |
PROP_PLAINURIS
Deprecated. If true, all hyperlinks are translated as well, regardless whether they are surrounded by brackets. |
static String |
PROP_RUNPLUGINS
Deprecated. If set to "true", enables plugins during parsing |
static String |
PROP_USEOUTLINKIMAGE
Deprecated. If true, all outward links (external links) have a small link image appended. |
static String |
PROP_USERELNOFOLLOW
Deprecated. If set to "true", all external links are tagged with 'rel="nofollow"' |
Fields inherited from class java.io.Reader |
---|
lock |
Constructor Summary | |
---|---|
TranslatorReader(WikiContext context,
Reader in)
Deprecated. Creates a TranslatorReader using the default HTML renderer. |
|
TranslatorReader(WikiContext context,
Reader in,
Object renderer)
Deprecated. Creates a TranslatorReader. |
Method Summary | |
---|---|
void |
addAttachmentLinkHook(StringTransmutator mutator)
Deprecated. Adds a hook for processing attachment links. |
void |
addExternalLinkHook(StringTransmutator mutator)
Deprecated. Adds a hook for processing external links. |
void |
addHeadingListener(HeadingListener listener)
Deprecated. Adds a listener to headings. |
void |
addLinkTransmutator(StringTransmutator mutator)
Deprecated. Adds a hook for processing link texts. |
void |
addLocalLinkHook(StringTransmutator mutator)
Deprecated. Adds a hook for processing local links. |
static String |
cleanLink(String link)
Deprecated. Cleans a Wiki name. |
void |
close()
Deprecated. |
void |
disableAccessRules()
Deprecated. Disables access rules parsing. |
void |
enableImageInlining(boolean toggle)
Deprecated. Use this to turn on or off image inlining. |
void |
enablePlugins(boolean toggle)
Deprecated. Can be used to turn on plugin execution on a translator-reader basis |
protected static Collection |
getImagePatterns(WikiEngine engine)
Deprecated. Figure out which image suffixes should be inlined. |
String |
makeLink(int type,
String link,
String text)
Deprecated. Write a HTMLized link depending on its type. |
int |
read()
Deprecated. |
int |
read(char[] buf,
int off,
int len)
Deprecated. |
boolean |
ready()
Deprecated. |
Reader |
setInputReader(Reader in)
Deprecated. Replaces the current input character stream with a new one. |
protected void |
setRenderer(Object renderer)
Deprecated. Does not work, don't try to use it. |
Methods inherited from class java.io.Reader |
---|
mark, markSupported, read, 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 String PROP_INLINEIMAGEPTRN
public static final String PROP_CAMELCASELINKS
public static final String PROP_PLAINURIS
public static final String PROP_USEOUTLINKIMAGE
public static final String PROP_ALLOWHTML
public static final String PROP_USERELNOFOLLOW
public static final String PROP_RUNPLUGINS
public static final String DEFAULT_INLINEPATTERN
Constructor Detail |
---|
public TranslatorReader(WikiContext context, Reader in)
context
- WikiContextin
- The reader from which to read.public TranslatorReader(WikiContext context, Reader in, Object renderer)
context
- WikiContextin
- Readerrenderer
- Unused.Method Detail |
---|
public Reader setInputReader(Reader in)
in
- New source for input. If null, this method does nothing.
protected void setRenderer(Object renderer)
renderer
- Renderer.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.public void addHeadingListener(HeadingListener listener)
listener
- Listener to add.public void disableAccessRules()
public void enablePlugins(boolean toggle)
toggle
- on or offpublic void enableImageInlining(boolean toggle)
toggle
- If true, images are inlined (as per set in jspwiki.properties)
If false, then images won't be inlined; instead, they will be
treated as standard hyperlinks.protected static Collection getImagePatterns(WikiEngine engine)
engine
- WikiEngine
public String makeLink(int type, String link, String text)
type
- Type of the link.link
- The actual link.text
- The user-visible text for the link.
public static String cleanLink(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 IOException
read
in class Reader
IOException
public int read(char[] buf, int off, int len) throws IOException
read
in class Reader
IOException
public boolean ready() throws IOException
ready
in class Reader
IOException
public void close()
close
in interface Closeable
close
in class Reader
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |