org.eclipse.mylyn.wikitext.textile.core
Class TextileLanguage

java.lang.Object
  extended by org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage
      extended by org.eclipse.mylyn.wikitext.core.parser.markup.AbstractMarkupLanguage
          extended by org.eclipse.mylyn.wikitext.textile.core.TextileLanguage
All Implemented Interfaces:
Cloneable

public class TextileLanguage
extends AbstractMarkupLanguage

A textile dialect that parses Textile markup. Based on the spec available at http://textile.thresholdstate.com/, supports all current Textile markup constructs. Additionally supported are {toc} and {glossary}.

Since:
1.0
Author:
David Green

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage
MarkupLanguage.PatternBasedSyntax
 
Field Summary
 
Fields inherited from class org.eclipse.mylyn.wikitext.core.parser.markup.AbstractMarkupLanguage
blocks, paragraphBreakingBlocks, phraseModifierSyntax, tokenSyntax
 
Fields inherited from class org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage
configuration, internalLinkPattern
 
Constructor Summary
TextileLanguage()
           
 
Method Summary
protected  void addBlockExtensions(List<Block> blocks, List<Block> paragraphBreakingBlocks)
          subclasses may override this method to add blocks to the Textile language.
protected  void addStandardBlocks(List<Block> blocks, List<Block> paragraphBreakingBlocks)
           
protected  void addStandardPhraseModifiers(MarkupLanguage.PatternBasedSyntax phraseModifierSyntax)
           
protected  void addStandardTokens(MarkupLanguage.PatternBasedSyntax tokenSyntax)
           
 TextileLanguage clone()
           
 void configure(MarkupLanguageConfiguration configuration)
          configure the markup language with a configuration that may alter the language syntax and capabilities.
protected  Block createParagraphBlock()
           
protected  ContentState createState()
          Create new state for tracking a document and its contents during a parse session.
 boolean isPreprocessFootnotes()
          indicate if footnotes should be preprocessed to avoid false-positives when footnote references are used inadvertently.
 void processContent(MarkupParser parser, String markupContent, boolean asDocument)
           
 void setPreprocessFootnotes(boolean preprocessFootnotes)
          indicate if footnotes should be preprocessed to avoid false-positives when footnote references are used inadvertently.
 
Methods inherited from class org.eclipse.mylyn.wikitext.core.parser.markup.AbstractMarkupLanguage
addPhraseModifierExtensions, addTokenExtensions, clearLanguageSyntax, getBlocks, getParagraphBreakingBlocks, getPhraseModifierSyntax, getReplacementTokenSyntax, initializeBlocks, initializePhraseModifiers, initializeSyntax, initializeTokens
 
Methods inherited from class org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage
emitMarkupLine, emitMarkupLine, emitMarkupText, getExtendsLanguage, getIdGenerationStrategy, getInternalLinkPattern, getName, isBlocksOnly, isDetectingRawHyperlinks, isEmptyLine, isEnableMacros, isFilterGenerativeContents, setBlocksOnly, setEnableMacros, setExtendsLanguage, setFilterGenerativeContents, setInternalLinkPattern, setName, startBlock
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextileLanguage

public TextileLanguage()
Method Detail

addBlockExtensions

protected void addBlockExtensions(List<Block> blocks,
                                  List<Block> paragraphBreakingBlocks)
subclasses may override this method to add blocks to the Textile language. Overriding classes should call super.addBlockExtensions(blocks,paragraphBreakingBlocks) if the default language extensions are desired (glossary and table of contents).

Overrides:
addBlockExtensions in class AbstractMarkupLanguage
Parameters:
blocks - the list of blocks to which extensions may be added
paragraphBreakingBlocks - the list of blocks that end a paragraph

createState

protected ContentState createState()
Description copied from class: MarkupLanguage
Create new state for tracking a document and its contents during a parse session. Subclasses may override this method to provide additional state tracking capability.

Overrides:
createState in class MarkupLanguage
Returns:
the new state.

addStandardBlocks

protected void addStandardBlocks(List<Block> blocks,
                                 List<Block> paragraphBreakingBlocks)
Specified by:
addStandardBlocks in class AbstractMarkupLanguage

addStandardPhraseModifiers

protected void addStandardPhraseModifiers(MarkupLanguage.PatternBasedSyntax phraseModifierSyntax)
Specified by:
addStandardPhraseModifiers in class AbstractMarkupLanguage

addStandardTokens

protected void addStandardTokens(MarkupLanguage.PatternBasedSyntax tokenSyntax)
Specified by:
addStandardTokens in class AbstractMarkupLanguage

createParagraphBlock

protected Block createParagraphBlock()
Specified by:
createParagraphBlock in class AbstractMarkupLanguage

isPreprocessFootnotes

public boolean isPreprocessFootnotes()
indicate if footnotes should be preprocessed to avoid false-positives when footnote references are used inadvertently. The default is false.


setPreprocessFootnotes

public void setPreprocessFootnotes(boolean preprocessFootnotes)
indicate if footnotes should be preprocessed to avoid false-positives when footnote references are used inadvertently. The default is false.


configure

public void configure(MarkupLanguageConfiguration configuration)
               throws UnsupportedOperationException
Description copied from class: MarkupLanguage
configure the markup language with a configuration that may alter the language syntax and capabilities.

Overrides:
configure in class MarkupLanguage
Parameters:
configuration - the configuration to use
Throws:
UnsupportedOperationException - markup languages that do not support configuration must throw this exception.

clone

public TextileLanguage clone()
Overrides:
clone in class MarkupLanguage

processContent

public void processContent(MarkupParser parser,
                           String markupContent,
                           boolean asDocument)
Overrides:
processContent in class MarkupLanguage


Copyright © 2011 FuseSource, Corp.. All Rights Reserved.