| java.lang.Object org.jamwiki.parser.ParserUtil
ParserUtil | public class ParserUtil (Code) | | This class provides utility methods for use with the parser functions.
|
Method Summary | |
public static String | parse(ParserInput parserInput, ParserOutput parserOutput, String content) Using the system parser, parse system content.
Parameters: parserInput - A ParserInput object that contains parserconfiguration information. Parameters: parserOutput - A ParserOutput object that will hold metadataoutput. | public static ParserOutput | parseMetadata(ParserInput parserInput, String content) This method provides a way to parse content and set all output metadata,
such as link values used by the search engine.
Parameters: parserInput - A ParserInput object that contains parser configurationinformation. Parameters: content - The raw topic content that is to be parsed. | public static String | parseMinimal(ParserInput parserInput, String raw) Perform a bare minimum of parsing as required prior to saving a topic
to the database. | public static String | parseSlice(String context, Locale locale, String virtualWiki, String topicName, int section) When editing a section of a topic, this method provides a way of slicing
out a given section of the raw topic content.
Parameters: context - The servlet context. Parameters: locale - The locale for which the content is being parsed. Parameters: virtualWiki - The virtual wiki for the topic being parsed. Parameters: topicName - The name of the topic being parsed. Parameters: targetSection - The section to be sliced and returned. | public static String | parseSplice(ParserOutput parserOutput, String context, Locale locale, String virtualWiki, String topicName, int targetSection, String replacementText) When editing a section of a topic, this method provides a way of splicing
an edited section back into the raw topic content.
Parameters: parserOutput - A ParserOutput object containing parsermetadata output. Parameters: context - The servlet context. Parameters: locale - The locale for which the content is being parsed. Parameters: virtualWiki - The virtual wiki for the topic being parsed. Parameters: topicName - The name of the topic being parsed. Parameters: targetSection - The section to be sliced and returned. Parameters: replacementText - The edited content that is to be spliced back intothe raw topic. | public static ParserOutput | parserOutput(String content, String virtualWiki, String topicName) Retrieve a default ParserOutput object for a given topic name. | public static String | parserRedirectContent(String topicName) Given a topic name, return the parser-specific syntax to indicate a page
redirect.
Parameters: topicName - The name of the topic that is being redirected to. |
parse | public static String parse(ParserInput parserInput, ParserOutput parserOutput, String content) throws Exception(Code) | | Using the system parser, parse system content.
Parameters: parserInput - A ParserInput object that contains parserconfiguration information. Parameters: parserOutput - A ParserOutput object that will hold metadataoutput. If this parameter is null then metadata generatedduring parsing will not be available to the calling method. Parameters: content - The raw topic content that is to be parsed. The parsed content. throws: Exception - Thrown if there are any parsing errors. |
parseMetadata | public static ParserOutput parseMetadata(ParserInput parserInput, String content) 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: parserInput - A ParserInput object that contains parser configurationinformation. Parameters: content - The raw topic content that is to be parsed. Returns a ParserOutput object with minimally parsed topic contentand other parser output fields set. throws: Exception - Thrown if there are any parsing errors. |
parseMinimal | public static String parseMinimal(ParserInput parserInput, 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: parserInput - A ParserInput object that contains parser configurationinformation. Parameters: raw - The raw Wiki syntax to be converted into HTML. The parsed content. throws: Exception - Thrown if any error occurs during parsing. |
parseSlice | public static String parseSlice(String context, Locale locale, String virtualWiki, String topicName, int section) throws Exception(Code) | | When editing a section of a topic, this method provides a way of slicing
out a given section of the raw topic content.
Parameters: context - The servlet context. Parameters: locale - The locale for which the content is being parsed. Parameters: virtualWiki - The virtual wiki for the topic being parsed. Parameters: topicName - The name of the topic being parsed. Parameters: targetSection - The section to be sliced and returned. Returns the raw topic content for the target section. throws: Exception - Thrown if a parser error occurs. |
parseSplice | public static String parseSplice(ParserOutput parserOutput, String context, Locale locale, String virtualWiki, String topicName, int targetSection, String replacementText) throws Exception(Code) | | When editing a section of a topic, this method provides a way of splicing
an edited section back into the raw topic content.
Parameters: parserOutput - A ParserOutput object containing parsermetadata output. Parameters: context - The servlet context. Parameters: locale - The locale for which the content is being parsed. Parameters: virtualWiki - The virtual wiki for the topic being parsed. Parameters: topicName - The name of the topic being parsed. Parameters: targetSection - The section to be sliced and returned. Parameters: replacementText - The edited content that is to be spliced back intothe raw topic. The raw topic content including the new replacement text. throws: Exception - Thrown if a parser error occurs. |
parserOutput | public static ParserOutput parserOutput(String content, String virtualWiki, String topicName) throws Exception(Code) | | Retrieve a default ParserOutput object for a given topic name. Note that
the content has almost no parsing performed on it other than to generate
parser output metadata.
Parameters: content - The raw topic content. Returns a minimal ParserOutput object initialized primarily withparser metadata such as links. throws: Exception - Thrown if a parser error occurs. |
parserRedirectContent | public static String parserRedirectContent(String topicName) throws Exception(Code) | | Given a topic name, return the parser-specific syntax to indicate a page
redirect.
Parameters: topicName - The name of the topic that is being redirected to. A string containing the syntax indicating a redirect. throws: Exception - Thrown if a parser instance cannot be instantiated orif any other parser error occurs. |
|
|