org.eclipse.mylyn.wikitext.core.parser.markup
Class PatternBasedElement

java.lang.Object
  extended by org.eclipse.mylyn.wikitext.core.parser.markup.PatternBasedElement
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
AcronymReplacementToken, AnchorReplacementToken, AutoLinkSwitchPhraseModifier, BangEscapeToken, ChangesetLinkReplacementToken, ConfluenceWrappedPhraseModifier, EmphasisPhraseModifier, EntityReferenceReplacementToken, EntityWrappingReplacementToken, EscapedCharacterReplacementToken, EscapePhraseModifier, EscapePhraseModifier, EscapeTextilePhraseModifier, FootnoteReferenceReplacementToken, HtmlCommentPhraseModifier, HtmlEndTagPhraseModifier, HtmlStartTagPhraseModifier, HyperlinkExternalReplacementToken, HyperlinkInternalReplacementToken, HyperlinkPhraseModifier, HyperlinkReplacementToken, HyperlinkReplacementToken, HyperlinkReplacementToken, IconReplacementToken, ImagePhraseModifier, ImageReplacementToken, ImageTextilePhraseModifier, ImpliedEmailLinkReplacementToken, ImpliedHyperlinkReplacementToken, LimitedHtmlEndTagPhraseModifier, LimitedHtmlStartTagPhraseModifier, LineBreakToken, LineBreakToken, LinkReplacementToken, MilestoneLinkReplacementToken, MonospacePhraseModifier, PatternEntityReferenceReplacementToken, PatternLineBreakReplacementToken, PatternLiteralReplacementToken, ReportLinkReplacementToken, RevisionLogReplacementToken, SimpleTextilePhraseModifier, SimpleWrappedPhraseModifier, SimpleWrappedPhraseModifier, SimpleWrappedPhraseModifier, SimpleWrappedPhraseModifier, SourceLinkReplacementToken, TicketAttachmentLinkReplacementToken, TicketLinkReplacementToken, UnknownMacroReplacementToken, WikiLinkReplacementToken, WikiWordReplacementToken, WikiWordReplacementToken

public abstract class PatternBasedElement
extends Object
implements Cloneable

An element of markup that is detected using a regular expression pattern. Serves as a means of detecting markup elements and providing a factory for processors that can process the markup element. Implementations of this class must be thread-safe (generally stateless).

Author:
David Green

Constructor Summary
PatternBasedElement()
           
 
Method Summary
 PatternBasedElement clone()
           
protected abstract  String getPattern(int groupOffset)
          Get the regular expression pattern that matches this element.
protected abstract  int getPatternGroupCount()
          The number of capturing groups in the pattern.
protected abstract  PatternBasedElementProcessor newProcessor()
          create a new processor for processing the type of element detected by this class.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternBasedElement

public PatternBasedElement()
Method Detail

getPattern

protected abstract String getPattern(int groupOffset)
Get the regular expression pattern that matches this element. Generally the pattern may be assembled into a single larger regular expression.

Parameters:
groupOffset - the offset of the groups in the pattern, 0 indicating no offset
Returns:
the regular expression pattern

getPatternGroupCount

protected abstract int getPatternGroupCount()
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.


newProcessor

protected abstract PatternBasedElementProcessor newProcessor()
create a new processor for processing the type of element detected by this class.


clone

public PatternBasedElement clone()
Overrides:
clone in class Object


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