public class JSPWikiMarkupParser extends MarkupParser
Modifier and Type | Field and Description |
---|---|
protected static int |
ATTACHMENT |
protected static int |
CHARACTER
The token is a plain character.
|
protected static int |
EDIT |
protected static int |
ELEMENT
The token is a wikimarkup element.
|
protected static int |
EMPTY |
protected static int |
EXTERNAL |
protected static int |
IGNORE
The token is to be ignored.
|
protected static int |
IMAGE |
protected static int |
IMAGELINK |
protected static int |
IMAGEWIKILINK |
protected static int |
INTERWIKI |
protected static int |
LOCAL |
protected static int |
LOCALREF |
static String |
PROP_CAMELCASELINKS
If true, consider CamelCase hyperlinks as well.
|
static String |
PROP_PLAINURIS
If true, all hyperlinks are translated as well, regardless whether they
are surrounded by brackets.
|
static String |
PROP_USEATTACHMENTIMAGE
If true, all outward attachment info links have a small link image appended.
|
protected static int |
READ |
CLASS_ATTACHMENT, CLASS_EDITPAGE, CLASS_EXTERNAL, CLASS_FOOTNOTE, CLASS_FOOTNOTE_REF, CLASS_INTERWIKI, CLASS_TYPES, CLASS_WIKIPAGE, HASHLINK, LEGACY_CHARS_ALLOWED, m_attachmentLinkMutatorChain, m_context, m_engine, m_externalLinkMutatorChain, m_headingListenerChain, m_in, m_inlineImagePatterns, m_inlineImages, m_linkMutators, m_linkParsingOperations, m_localLinkMutatorChain, m_parseAccessRules, OUTLINK, OUTLINK_IMAGE, PROP_ALLOWHTML, PROP_RUNPLUGINS, PROP_USEOUTLINKIMAGE, PROP_USERELNOFOLLOW, PUNCTUATION_CHARS_ALLOWED, PUSHBACK_BUFFER_SIZE
Constructor and Description |
---|
JSPWikiMarkupParser(WikiContext context,
Reader in)
Creates a markup parser.
|
Modifier and Type | Method and Description |
---|---|
protected void |
callHeadingListenerChain(Heading param)
Calls the heading listeners.
|
protected String |
callMutatorChain(Collection<StringTransmutator> list,
String text)
Calls a transmutator chain.
|
protected org.jdom2.Element |
createAnchor(int type,
String link,
String text,
String section)
Creates a JDOM anchor element.
|
org.jdom2.Element |
makeHeading(int level,
String title,
Heading hd)
Returns XHTML for the heading.
|
WikiDocument |
parse()
Parses the entire document from the Reader given in the constructor or
set by
MarkupParser.setInputReader(Reader) . |
protected int |
parseToken(int ch)
Return CHARACTER, if you think this was a plain character; ELEMENT, if
you think this was a wiki markup element, and IGNORE, if you think
we should ignore this altogether.
|
addAttachmentLinkHook, addExternalLinkHook, addHeadingListener, addLinkTransmutator, addLocalLinkHook, cleanLink, cleanLink, disableAccessRules, enableImageInlining, getInlineImagePatterns, getPosition, initInlineImagePatterns, isImageInlining, isParseAccessRules, makeError, nextToken, pushBack, setInputReader, wikifyLink
protected static final int READ
protected static final int EDIT
protected static final int EMPTY
protected static final int LOCAL
protected static final int LOCALREF
protected static final int IMAGE
protected static final int EXTERNAL
protected static final int INTERWIKI
protected static final int IMAGELINK
protected static final int IMAGEWIKILINK
protected static final int ATTACHMENT
public static final String PROP_CAMELCASELINKS
public static final String PROP_PLAINURIS
public static final String PROP_USEATTACHMENTIMAGE
protected static final int CHARACTER
protected static final int ELEMENT
protected static final int IGNORE
public JSPWikiMarkupParser(WikiContext context, Reader in)
context
- The WikiContext which controls the parsingin
- Where the data is read from.protected String callMutatorChain(Collection<StringTransmutator> list, String text)
list
- Chain to calltext
- Text that should be passed to the mutate() method of each of the mutators in the chain.protected void callHeadingListenerChain(Heading param)
param
- A Heading object.protected org.jdom2.Element createAnchor(int type, String link, String text, String section)
type
- One of the types abovelink
- URL to which to link totext
- Link textsection
- If a particular section identifier is required.public org.jdom2.Element makeHeading(int level, String title, Heading hd)
level
- The level of the heading. @see Headingtitle
- the title for the headinghd
- a List to which heading should be addedprotected int parseToken(int ch) throws IOException
To add your own MarkupParser, you can override this method, but it is recommended that you call super.parseToken() as well to gain advantage of JSPWiki's own markup. You can call it at the start of your own parseToken() or end - it does not matter.
ch
- The character under investigationELEMENT
, CHARACTER
or IGNORE
.IOException
- If parsing fails.public WikiDocument parse() throws IOException
MarkupParser.setInputReader(Reader)
.parse
in class MarkupParser
IOException
- If parsing cannot be accomplished.Copyright © 2001-2019 The Apache Software Foundation. All rights reserved.