public class TranslatorReader
extends java.io.Reader
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.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_INLINEPATTERN
Deprecated.
The default inlining pattern.
|
static java.lang.String |
PROP_ALLOWHTML
Deprecated.
If set to "true", allows using raw HTML within Wiki text.
|
static java.lang.String |
PROP_CAMELCASELINKS
Deprecated.
If true, consider CamelCase hyperlinks as well.
|
static java.lang.String |
PROP_INLINEIMAGEPTRN
Deprecated.
This property defines the inline image pattern.
|
static java.lang.String |
PROP_PLAINURIS
Deprecated.
If true, all hyperlinks are translated as well, regardless whether they
are surrounded by brackets.
|
static java.lang.String |
PROP_RUNPLUGINS
Deprecated.
If set to "true", enables plugins during parsing
|
static java.lang.String |
PROP_USEOUTLINKIMAGE
Deprecated.
If true, all outward links (external links) have a small link image appended.
|
static java.lang.String |
PROP_USERELNOFOLLOW
Deprecated.
If set to "true", all external links are tagged with 'rel="nofollow"'
|
Constructor and Description |
---|
TranslatorReader(WikiContext context,
java.io.Reader in)
Deprecated.
Creates a TranslatorReader using the default HTML renderer.
|
TranslatorReader(WikiContext context,
java.io.Reader in,
java.lang.Object renderer)
Deprecated.
Creates a TranslatorReader.
|
Modifier and Type | Method and Description |
---|---|
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 java.lang.String |
cleanLink(java.lang.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 java.util.Collection |
getImagePatterns(WikiEngine engine)
Deprecated.
Figure out which image suffixes should be inlined.
|
java.lang.String |
makeLink(int type,
java.lang.String link,
java.lang.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.
|
java.io.Reader |
setInputReader(java.io.Reader in)
Deprecated.
Replaces the current input character stream with a new one.
|
protected void |
setRenderer(java.lang.Object renderer)
Deprecated.
Does not work, don't try to use it.
|
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 PROP_USERELNOFOLLOW
public static final java.lang.String PROP_RUNPLUGINS
public static final java.lang.String DEFAULT_INLINEPATTERN
public TranslatorReader(WikiContext context, java.io.Reader in)
context
- WikiContextin
- The reader from which to read.public TranslatorReader(WikiContext context, java.io.Reader in, java.lang.Object renderer)
context
- WikiContextin
- Readerrenderer
- Unused.public java.io.Reader setInputReader(java.io.Reader in)
in
- New source for input. If null, this method does nothing.protected void setRenderer(java.lang.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 java.util.Collection getImagePatterns(WikiEngine engine)
engine
- WikiEnginepublic 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.Reader
java.io.IOException
public int read(char[] buf, int off, int len) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public boolean ready() throws java.io.IOException
ready
in class java.io.Reader
java.io.IOException
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Reader
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.