com.atlassian.renderer.v2.macro.code.formatter
Class AbstractFormatter

java.lang.Object
  extended by com.atlassian.renderer.v2.macro.code.formatter.AbstractFormatter
All Implemented Interfaces:
SourceCodeFormatter
Direct Known Subclasses:
ActionScriptFormatter, JavaFormatter, JavaScriptFormatter, NoneFormatter, SqlFormatter, XmlFormatter

public abstract class AbstractFormatter
extends Object
implements SourceCodeFormatter


Field Summary
static String COMMENTS_REPLACEMENT
           
static String KEYWORD_REPLACEMENT
           
static String LINE_COMMENTS
           
static String OBJECT_REPLACEMENT
           
static String QUOTES
           
static String QUOTES_REPLACEMENT
           
protected  List replacers
           
 
Constructor Summary
AbstractFormatter()
           
 
Method Summary
protected  void addReplacement(String pattern, String replacement)
           
 String format(String code, String language)
          Convert source code into HTML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.renderer.v2.macro.code.SourceCodeFormatter
getSupportedLanguages
 

Field Detail

QUOTES

public static final String QUOTES
See Also:
Constant Field Values

LINE_COMMENTS

public static final String LINE_COMMENTS
See Also:
Constant Field Values

QUOTES_REPLACEMENT

public static final String QUOTES_REPLACEMENT
See Also:
Constant Field Values

COMMENTS_REPLACEMENT

public static final String COMMENTS_REPLACEMENT
See Also:
Constant Field Values

KEYWORD_REPLACEMENT

public static final String KEYWORD_REPLACEMENT
See Also:
Constant Field Values

OBJECT_REPLACEMENT

public static final String OBJECT_REPLACEMENT
See Also:
Constant Field Values

replacers

protected List replacers
Constructor Detail

AbstractFormatter

public AbstractFormatter()
Method Detail

addReplacement

protected void addReplacement(String pattern,
                              String replacement)

format

public String format(String code,
                     String language)
Description copied from interface: SourceCodeFormatter
Convert source code into HTML.

Specified by:
format in interface SourceCodeFormatter
Parameters:
code - the source code as a string
language - the programming language that it is believed this code is written in
Returns:
the source code formatted as HTML


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.