com.atlassian.renderer.v2.components
Class BackslashEscapeRendererComponent

java.lang.Object
  extended by com.atlassian.renderer.v2.components.AbstractRendererComponent
      extended by com.atlassian.renderer.v2.components.AbstractRegexRendererComponent
          extended by com.atlassian.renderer.v2.components.BackslashEscapeRendererComponent
All Implemented Interfaces:
RendererComponent

public class BackslashEscapeRendererComponent
extends AbstractRegexRendererComponent

Escapes certain symbols prefixed with backslash (\) into html entities. Most symbols in wiki markup cannot be escaped with wiki markup, so that the backslash character can be interpreted in a literal most of the time. This makes it easier to do things such as pasting windows file paths into wiki markup.


Constructor Summary
BackslashEscapeRendererComponent()
           
 
Method Summary
 void appendSubstitution(StringBuffer buffer, RenderContext context, Matcher matcher)
          Implement this method to perform your actual regex substitution.
static String escapeWiki(String str)
          This method will escape with a backslash the characters that are rendered by the render(java.lang.String, com.atlassian.renderer.RenderContext) method.
 String render(String wiki, RenderContext context)
          Render this piece of wiki text.
 boolean shouldRender(RenderMode renderMode)
          Whether or not this render component is required given the current render mode.
 
Methods inherited from class com.atlassian.renderer.v2.components.AbstractRegexRendererComponent
regexRender
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BackslashEscapeRendererComponent

public BackslashEscapeRendererComponent()
Method Detail

escapeWiki

public static String escapeWiki(String str)
This method will escape with a backslash the characters that are rendered by the render(java.lang.String, com.atlassian.renderer.RenderContext) method. This is probably not the best method to use to escape anything so if possible do not call it.


shouldRender

public boolean shouldRender(RenderMode renderMode)
Description copied from interface: RendererComponent
Whether or not this render component is required given the current render mode.

Specified by:
shouldRender in interface RendererComponent
Specified by:
shouldRender in class AbstractRegexRendererComponent

render

public String render(String wiki,
                     RenderContext context)
Description copied from interface: RendererComponent
Render this piece of wiki text.

Specified by:
render in interface RendererComponent
Specified by:
render in class AbstractRegexRendererComponent

appendSubstitution

public void appendSubstitution(StringBuffer buffer,
                               RenderContext context,
                               Matcher matcher)
Description copied from class: AbstractRegexRendererComponent
Implement this method to perform your actual regex substitution.

Specified by:
appendSubstitution in class AbstractRegexRendererComponent


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.