org.eclipse.mylyn.internal.wikitext.textile.core.phrase
Class SimpleTextilePhraseModifier

java.lang.Object
  extended by org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElement
      extended by org.eclipse.mylyn.internal.wikitext.textile.core.phrase.SimpleTextilePhraseModifier
All Implemented Interfaces:
Cloneable

public class SimpleTextilePhraseModifier
extends PatternBasedElement

A simple phrase modifier implementation that matches a pattern in text and emits a span containing the content of the matched region.

Author:
David Green

Nested Class Summary
static class SimpleTextilePhraseModifier.Mode
           
 
Field Summary
protected static int ATTRIBUTES_OFFSET
           
protected static int CONTENT_GROUP
           
 
Constructor Summary
SimpleTextilePhraseModifier(String delimiter, DocumentBuilder.SpanType spanType, SimpleTextilePhraseModifier.Mode mode)
           
 
Method Summary
protected static void configureAttributes(PatternBasedElementProcessor processor, Attributes attributes)
           
protected static String getContent(PatternBasedElementProcessor processor)
           
protected  String getDelimiter()
           
protected  String getPattern(int groupOffset)
          Get the regular expression pattern that matches this element.
protected  int getPatternGroupCount()
          The number of capturing groups in the pattern.
protected static int getStart(PatternBasedElementProcessor processor)
           
protected  PatternBasedElementProcessor newProcessor()
          create a new processor for processing the type of element detected by this class.
 
Methods inherited from class org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElement
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_GROUP

protected static final int CONTENT_GROUP
See Also:
Constant Field Values

ATTRIBUTES_OFFSET

protected static final int ATTRIBUTES_OFFSET
See Also:
Constant Field Values
Constructor Detail

SimpleTextilePhraseModifier

public SimpleTextilePhraseModifier(String delimiter,
                                   DocumentBuilder.SpanType spanType,
                                   SimpleTextilePhraseModifier.Mode mode)
Parameters:
delimiter - the text pattern to detect
spanType - the type of span to be emitted for this phrase modifier
nesting - indicate if this phrase modifier allows nested phrase modifiers
Method Detail

getPattern

protected String getPattern(int groupOffset)
Description copied from class: PatternBasedElement
Get the regular expression pattern that matches this element. Generally the pattern may be assembled into a single larger regular expression.

Specified by:
getPattern in class PatternBasedElement
Parameters:
groupOffset - the offset of the groups in the pattern, 0 indicating no offset
Returns:
the regular expression pattern

getPatternGroupCount

protected int getPatternGroupCount()
Description copied from class: PatternBasedElement
The number of capturing groups in the pattern. Note that implementations must take care to return the correct value otherwise the markup language will not work correctly.

Specified by:
getPatternGroupCount in class PatternBasedElement

getDelimiter

protected String getDelimiter()

configureAttributes

protected static void configureAttributes(PatternBasedElementProcessor processor,
                                          Attributes attributes)

getContent

protected static String getContent(PatternBasedElementProcessor processor)

getStart

protected static int getStart(PatternBasedElementProcessor processor)

newProcessor

protected PatternBasedElementProcessor newProcessor()
Description copied from class: PatternBasedElement
create a new processor for processing the type of element detected by this class.

Specified by:
newProcessor in class PatternBasedElement


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