| java.lang.Object org.jamwiki.parser.AbstractParser
All known Subclasses: org.jamwiki.parser.jflex.JFlexParser,
AbstractParser | abstract public class AbstractParser (Code) | | Abstract class to be used when implementing new parsers. New parsers
should extend this class and override any methods that need to be
implemented differently.
|
Constructor Summary | |
public | AbstractParser(ParserInput parserInput) The constructor creates a parser instance, initialized with the
specified parser input settings. |
Method Summary | |
abstract public String | buildRedirectContent(String topicName) Return a parser-specific value that can be used as the content of a
topic representing a redirect. | abstract public String | parseFragment(ParserOutput parserOutput, String raw, int mode) This method parses content, performing all transformations except for
layout changes such as adding paragraph tags. | abstract public String | parseHTML(ParserOutput parserOutput, String raw) Returns a HTML representation of the given wiki raw text for online
representation.
Parameters: parserOutput - A ParserOutput object containing parsermetadata output. Parameters: raw - The raw Wiki syntax to be converted into HTML. | abstract public void | parseMetadata(ParserOutput parserOutput, String raw) This method provides a way to parse content and set all output
metadata, such as link values used by the search engine. | abstract public String | parseMinimal(String raw) Perform a bare minimum of parsing as required prior to saving a topic
to the database. | abstract public String | parseSlice(ParserOutput parserOutput, String raw, int targetSection) When making a section edit this function provides the capability to retrieve
all text within a specific heading level. | abstract public String | parseSplice(ParserOutput parserOutput, String raw, int targetSection, String replacementText) This method provides the capability for re-integrating a section edit back
into the main topic. |
AbstractParser | public AbstractParser(ParserInput parserInput)(Code) | | The constructor creates a parser instance, initialized with the
specified parser input settings.
Parameters: parserInput - Input configuration settings for this parserinstance. |
buildRedirectContent | abstract public String buildRedirectContent(String topicName)(Code) | | Return a parser-specific value that can be used as the content of a
topic representing a redirect. For the Mediawiki syntax parser the
value returned would be of the form "#REDIRECT [[Topic]]".
Parameters: topicName - The name of the topic to redirect to. A parser-specific value that can be used as the content of atopic representing a redirect. |
parseFragment | abstract public String parseFragment(ParserOutput parserOutput, String raw, int mode) throws Exception(Code) | | This method parses content, performing all transformations except for
layout changes such as adding paragraph tags. It is suitable to be used
when parsing the contents of a link or performing similar internal
manipulation.
Parameters: parserOutput - A ParserOutput object containing parsermetadata output. Parameters: raw - The raw Wiki syntax to be converted into HTML. Parameters: mode - The parser mode to use when parsing. Mode affects whattype of parsing actions are taken when processing raw text. The parsed content. throws: Exception - Thrown if any error occurs during parsing. |
parseHTML | abstract public String parseHTML(ParserOutput parserOutput, String raw) throws Exception(Code) | | Returns a HTML representation of the given wiki raw text for online
representation.
Parameters: parserOutput - A ParserOutput object containing parsermetadata output. Parameters: raw - The raw Wiki syntax to be converted into HTML. The parsed content. throws: Exception - Thrown if any error occurs during parsing. |
parseMetadata | abstract public void parseMetadata(ParserOutput parserOutput, String raw) throws Exception(Code) | | This method provides a way to parse content and set all output
metadata, such as link values used by the search engine.
Parameters: parserOutput - A ParserOutput object containing parsermetadata output. Parameters: raw - The raw Wiki syntax to be converted into HTML. throws: Exception - Thrown if any error occurs during parsing. |
parseMinimal | abstract public String parseMinimal(String raw) throws Exception(Code) | | Perform a bare minimum of parsing as required prior to saving a topic
to the database. In general this method will simply parse signature
tags are return.
Parameters: raw - The raw Wiki syntax to be converted into HTML. The parsed content. throws: Exception - Thrown if any error occurs during parsing. |
parseSlice | abstract public String parseSlice(ParserOutput parserOutput, String raw, int targetSection) throws Exception(Code) | | When making a section edit this function provides the capability to retrieve
all text within a specific heading level. For example, if targetSection is
specified as five, and the sixth heading is an <h2>, then this method
will return the heading tag and all text up to either the next <h2>,
<h1>, or the end of the document, whichever comes first.
Parameters: parserOutput - A ParserOutput object containing parsermetadata output. Parameters: raw - The raw Wiki text that is to be parsed. Parameters: targetSection - The section (counted from zero) that is to be returned. Returns the raw topic content for the target section. throws: Exception - Thrown if any error occurs during parsing. |
parseSplice | abstract public String parseSplice(ParserOutput parserOutput, String raw, int targetSection, String replacementText) throws Exception(Code) | | This method provides the capability for re-integrating a section edit back
into the main topic. The text to be re-integrated is provided along with the
full Wiki text and a targetSection. All of the content of targetSection
is then replaced with the new text.
Parameters: parserOutput - A ParserOutput object containing parsermetadata output. Parameters: raw - The raw Wiki text that is to be parsed. Parameters: targetSection - The section (counted from zero) that is to be returned. Parameters: replacementText - The text to replace the target section text with. The raw topic content including the new replacement text. throws: Exception - Thrown if any error occurs during parsing. |
|
|