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 EditorConvertereditConverterprotected RenderereditRendererprotected RenderingEventPublisherrenderingEventPublisherprotected StorageFormatCleanerstorageFormatCleanerprotected RendererviewRenderer
-
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 StringcleanEditorFormat(String wysiwygContent, com.atlassian.renderer.RenderContext renderContext)Cleans the editor formatStringcleanStorageFormat(String storageFormat)Cleans the storage formatStringconvertToEditorFormat(String storageFormat, com.atlassian.renderer.RenderContext renderContext)Converts the storage format into the editor format.RenderResultconvertToEditorFormatWithResult(String storageFormat, com.atlassian.renderer.RenderContext renderContext)Converts the storage format into the editor format.StringconvertToStorageFormat(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.StringconvertToViewFormat(String storageFormat, com.atlassian.renderer.RenderContext renderContext)Converts the storage format into the view format.StringvalidateAndConvertToStorageFormat(ConfluenceActionSupport action, String wysiwygContent, com.atlassian.renderer.RenderContext renderContext)Validates, and adds any errors to the action.StringvalidateAndConvertToStorageFormat(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:FormatConverterValidates, and adds any errors to the action. Returns the storage format if successful.- Specified by:
validateAndConvertToStorageFormatin 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:FormatConverterValidates, throwing exceptions if failures found. Returns the storage format if successful.- Specified by:
validateAndConvertToStorageFormatin interfaceFormatConverter- Returns:
- Throws:
BadRequestException
-
convertToStorageFormat
public String convertToStorageFormat(String wysiwygContent, com.atlassian.renderer.RenderContext renderContext) throws XhtmlException
Description copied from interface:FormatConverterReturns 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:
convertToStorageFormatin interfaceFormatConverter- Returns:
- the content that has been submitted as part of a user's attempt to add new content or edit existing content.
- Throws:
XhtmlParsingExceptionXhtmlException
-
convertToEditorFormat
public String convertToEditorFormat(String storageFormat, com.atlassian.renderer.RenderContext renderContext)
Description copied from interface:FormatConverterConverts the storage format into the editor format.- Specified by:
convertToEditorFormatin interfaceFormatConverter- Returns:
-
convertToEditorFormatWithResult
public RenderResult convertToEditorFormatWithResult(String storageFormat, com.atlassian.renderer.RenderContext renderContext)
Description copied from interface:FormatConverterConverts the storage format into the editor format.- Specified by:
convertToEditorFormatWithResultin interfaceFormatConverter- Returns:
-
convertToViewFormat
public String convertToViewFormat(String storageFormat, com.atlassian.renderer.RenderContext renderContext)
Description copied from interface:FormatConverterConverts the storage format into the view format.- Specified by:
convertToViewFormatin interfaceFormatConverter- Returns:
-
cleanEditorFormat
public String cleanEditorFormat(String wysiwygContent, com.atlassian.renderer.RenderContext renderContext) throws XhtmlException
Description copied from interface:FormatConverterCleans the editor format- Specified by:
cleanEditorFormatin interfaceFormatConverter- Returns:
- a cleaned version of the editorFormat
- Throws:
XhtmlException
-
cleanStorageFormat
public String cleanStorageFormat(String storageFormat)
Description copied from interface:FormatConverterCleans the storage format- Specified by:
cleanStorageFormatin interfaceFormatConverter- Returns:
- a cleaned version of the storageFormat
-
-