com.atlassian.renderer.v2.macro.code
Interface SourceCodeFormatter

All Known Implementing Classes:
AbstractFormatter, ActionScriptFormatter, JavaFormatter, JavaScriptFormatter, NoneFormatter, SqlFormatter, XmlFormatter

public interface SourceCodeFormatter

Strategy for converting a block of source code into pretty-printed HTML. SourceCodeFormatters MUST be forgiving: they will be dealing with user-supplied input, so they can't afford to blow up on bad data.


Method Summary
 java.lang.String format(java.lang.String code, java.lang.String language)
          Convert source code into HTML.
 java.lang.String[] getSupportedLanguages()
          Inform the CodeMacro which languages this formatter supports.
 

Method Detail

getSupportedLanguages

java.lang.String[] getSupportedLanguages()
Inform the CodeMacro which languages this formatter supports. So if someone writes {code:java}, then only the formatter that returns "java" from this method will be used to format it.

Returns:
an array of languages that this formatter supports

format

java.lang.String format(java.lang.String code,
                        java.lang.String language)
Convert source code into HTML.

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 © 2008 Atlassian Pty Ltd. All Rights Reserved.