com.atlassian.confluence.content.render.xhtml
Class DefaultFormatConverter

java.lang.Object
  extended by com.atlassian.confluence.content.render.xhtml.DefaultFormatConverter
All Implemented Interfaces:
FormatConverter

public class DefaultFormatConverter
extends java.lang.Object
implements FormatConverter


Field Summary
protected  EditorConverter editConverter
           
protected  Renderer editRenderer
           
protected  StorageFormatCleaner storageFormatCleaner
           
protected  Renderer viewRenderer
           
 
Constructor Summary
DefaultFormatConverter(EditorConverter editConverter, Renderer editRenderer, Renderer viewRenderer, StorageFormatCleaner storageFormatCleaner)
           
 
Method Summary
 java.lang.String convertToEditorFormat(java.lang.String storageFormat, com.atlassian.renderer.RenderContext renderContext)
          Converts the storage format into the editor format.
 java.lang.String convertToStorageFormat(java.lang.String wysiwygContent, com.atlassian.renderer.RenderContext renderContext)
          Returns the content that has been submitted as part of a user's attempt to add new content or edit existing content.
 java.lang.String convertToViewFormat(java.lang.String storageFormat, com.atlassian.renderer.RenderContext renderContext)
          Converts the storage format into the view format.
 java.lang.String validateAndConvertToStorageFormat(ConfluenceActionSupport action, java.lang.String wysiwygContent, com.atlassian.renderer.RenderContext renderContext)
          Validates, and adds any errors to the action.
 java.lang.String validateAndConvertToStorageFormat(java.lang.String wysiwygContent, com.atlassian.renderer.RenderContext renderContext)
          Validates, throwing exceptions if failures found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

editConverter

protected EditorConverter editConverter

editRenderer

protected Renderer editRenderer

viewRenderer

protected Renderer viewRenderer

storageFormatCleaner

protected StorageFormatCleaner storageFormatCleaner
Constructor Detail

DefaultFormatConverter

public DefaultFormatConverter(EditorConverter editConverter,
                              Renderer editRenderer,
                              Renderer viewRenderer,
                              StorageFormatCleaner storageFormatCleaner)
Method Detail

validateAndConvertToStorageFormat

public java.lang.String validateAndConvertToStorageFormat(ConfluenceActionSupport action,
                                                          java.lang.String wysiwygContent,
                                                          com.atlassian.renderer.RenderContext renderContext)
Description copied from interface: FormatConverter
Validates, and adds any errors to the action. Returns the storage format if successful.

Specified by:
validateAndConvertToStorageFormat in interface FormatConverter
Parameters:
action - action to add any errors found into
Returns:

validateAndConvertToStorageFormat

public java.lang.String validateAndConvertToStorageFormat(java.lang.String wysiwygContent,
                                                          com.atlassian.renderer.RenderContext renderContext)
                                                   throws BadRequestException
Description copied from interface: FormatConverter
Validates, throwing exceptions if failures found. Returns the storage format if successful.

Specified by:
validateAndConvertToStorageFormat in interface FormatConverter
Returns:
Throws:
BadRequestException

convertToStorageFormat

public java.lang.String convertToStorageFormat(java.lang.String wysiwygContent,
                                               com.atlassian.renderer.RenderContext renderContext)
                                        throws XhtmlException
Description copied from interface: FormatConverter
Returns the content that has been submitted as part of a user's attempt to add new content or edit existing content. The content is returned in storage format ready for saving.

Specified by:
convertToStorageFormat in interface FormatConverter
Returns:
the content that has been submitted as part of a user's attempt to add new content or edit existing content.
Throws:
XhtmlParsingException
XhtmlException

convertToEditorFormat

public java.lang.String convertToEditorFormat(java.lang.String storageFormat,
                                              com.atlassian.renderer.RenderContext renderContext)
Description copied from interface: FormatConverter
Converts the storage format into the editor format.

Specified by:
convertToEditorFormat in interface FormatConverter
Returns:

convertToViewFormat

public java.lang.String convertToViewFormat(java.lang.String storageFormat,
                                            com.atlassian.renderer.RenderContext renderContext)
Description copied from interface: FormatConverter
Converts the storage format into the view format.

Specified by:
convertToViewFormat in interface FormatConverter
Returns:


Copyright © 2003-2014 Atlassian. All Rights Reserved.