Class DefaultFormatConverter
- java.lang.Object
-
- com.atlassian.confluence.content.render.xhtml.DefaultFormatConverter
-
- All Implemented Interfaces:
FormatConverter
public class DefaultFormatConverter extends Object implements FormatConverter
-
-
Field Summary
Fields Modifier and Type Field Description protected EditorConverter
editConverter
protected Renderer
editRenderer
protected RenderingEventPublisher
renderingEventPublisher
protected StorageFormatCleaner
storageFormatCleaner
protected Renderer
viewRenderer
-
Constructor Summary
Constructors Constructor Description DefaultFormatConverter(EditorConverter editConverter, Renderer editRenderer, Renderer viewRenderer, StorageFormatCleaner storageFormatCleaner)
DefaultFormatConverter(EditorConverter editConverter, Renderer editRenderer, Renderer viewRenderer, StorageFormatCleaner storageFormatCleaner, RenderingEventPublisher renderingEventPublisher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
cleanEditorFormat(String wysiwygContent, com.atlassian.renderer.RenderContext renderContext)
Cleans the editor formatString
cleanStorageFormat(String storageFormat)
Cleans the storage formatString
convertToEditorFormat(String storageFormat, com.atlassian.renderer.RenderContext renderContext)
Converts the storage format into the editor format.RenderResult
convertToEditorFormatWithResult(String storageFormat, com.atlassian.renderer.RenderContext renderContext)
Converts the storage format into the editor format.String
convertToStorageFormat(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.String
convertToViewFormat(String storageFormat, com.atlassian.renderer.RenderContext renderContext)
Converts the storage format into the view format.String
validateAndConvertToStorageFormat(ConfluenceActionSupport action, String wysiwygContent, com.atlassian.renderer.RenderContext renderContext)
Validates, and adds any errors to the action.String
validateAndConvertToStorageFormat(String wysiwygContent, com.atlassian.renderer.RenderContext renderContext)
Validates, throwing exceptions if failures found.
-
-
-
Field Detail
-
editConverter
protected EditorConverter editConverter
-
editRenderer
protected Renderer editRenderer
-
viewRenderer
protected Renderer viewRenderer
-
storageFormatCleaner
protected StorageFormatCleaner storageFormatCleaner
-
renderingEventPublisher
protected RenderingEventPublisher renderingEventPublisher
-
-
Constructor Detail
-
DefaultFormatConverter
@Deprecated public DefaultFormatConverter(EditorConverter editConverter, Renderer editRenderer, Renderer viewRenderer, StorageFormatCleaner storageFormatCleaner)
-
DefaultFormatConverter
public DefaultFormatConverter(EditorConverter editConverter, Renderer editRenderer, Renderer viewRenderer, StorageFormatCleaner storageFormatCleaner, RenderingEventPublisher renderingEventPublisher)
-
-
Method Detail
-
validateAndConvertToStorageFormat
public String validateAndConvertToStorageFormat(ConfluenceActionSupport action, 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 interfaceFormatConverter
- Parameters:
action
- action to add any errors found into- Returns:
-
validateAndConvertToStorageFormat
public String validateAndConvertToStorageFormat(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 interfaceFormatConverter
- Returns:
- Throws:
BadRequestException
-
convertToStorageFormat
public String convertToStorageFormat(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 interfaceFormatConverter
- 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 String convertToEditorFormat(String storageFormat, com.atlassian.renderer.RenderContext renderContext)
Description copied from interface:FormatConverter
Converts the storage format into the editor format.- Specified by:
convertToEditorFormat
in interfaceFormatConverter
- Returns:
-
convertToEditorFormatWithResult
public RenderResult convertToEditorFormatWithResult(String storageFormat, com.atlassian.renderer.RenderContext renderContext)
Description copied from interface:FormatConverter
Converts the storage format into the editor format.- Specified by:
convertToEditorFormatWithResult
in interfaceFormatConverter
- Returns:
-
convertToViewFormat
public String convertToViewFormat(String storageFormat, com.atlassian.renderer.RenderContext renderContext)
Description copied from interface:FormatConverter
Converts the storage format into the view format.- Specified by:
convertToViewFormat
in interfaceFormatConverter
- Returns:
-
cleanEditorFormat
public String cleanEditorFormat(String wysiwygContent, com.atlassian.renderer.RenderContext renderContext) throws XhtmlException
Description copied from interface:FormatConverter
Cleans the editor format- Specified by:
cleanEditorFormat
in interfaceFormatConverter
- Returns:
- a cleaned version of the editorFormat
- Throws:
XhtmlException
-
cleanStorageFormat
public String cleanStorageFormat(String storageFormat)
Description copied from interface:FormatConverter
Cleans the storage format- Specified by:
cleanStorageFormat
in interfaceFormatConverter
- Returns:
- a cleaned version of the storageFormat
-
-