Class DefaultFormatConverter
java.lang.Object
com.atlassian.confluence.content.render.xhtml.DefaultFormatConverter
- All Implemented Interfaces:
FormatConverter
-
Field Summary
Modifier and TypeFieldDescriptionprotected EditorConverter
protected Renderer
protected RenderingEventPublisher
protected StorageFormatCleaner
protected Renderer
-
Constructor Summary
ConstructorDescriptionDefaultFormatConverter
(EditorConverter editConverter, Renderer editRenderer, Renderer viewRenderer, StorageFormatCleaner storageFormatCleaner) Deprecated.DefaultFormatConverter
(EditorConverter editConverter, Renderer editRenderer, Renderer viewRenderer, StorageFormatCleaner storageFormatCleaner, RenderingEventPublisher renderingEventPublisher) -
Method Summary
Modifier and TypeMethodDescriptioncleanEditorFormat
(String wysiwygContent, com.atlassian.renderer.RenderContext renderContext) Cleans the editor formatcleanStorageFormat
(String storageFormat) Cleans the storage formatconvertToEditorFormat
(String storageFormat, com.atlassian.renderer.RenderContext renderContext) Converts the storage format into the editor format.convertToEditorFormatWithResult
(String storageFormat, com.atlassian.renderer.RenderContext renderContext) Converts the storage format into the editor format.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.convertToViewFormat
(String storageFormat, com.atlassian.renderer.RenderContext renderContext) Converts the storage format into the view format.validateAndConvertToStorageFormat
(ConfluenceActionSupport action, String wysiwygContent, com.atlassian.renderer.RenderContext renderContext) Validates, and adds any errors to the action.validateAndConvertToStorageFormat
(String wysiwygContent, com.atlassian.renderer.RenderContext renderContext) Validates, throwing exceptions if failures found.
-
Field Details
-
editConverter
-
editRenderer
-
viewRenderer
-
storageFormatCleaner
-
renderingEventPublisher
-
-
Constructor Details
-
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 Details
-
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
Description copied from interface:FormatConverter
Cleans the storage format- Specified by:
cleanStorageFormat
in interfaceFormatConverter
- Returns:
- a cleaned version of the storageFormat
-
DefaultFormatConverter(com.atlassian.confluence.content.render.xhtml.editor.EditorConverter, Renderer, Renderer, StorageFormatCleaner, RenderingEventPublisher)