public interface ConversionContext
| Modifier and Type | Field and Description | 
|---|---|
| static String | IS_VALIDATING_COMMENTThis property will be set when validating a comment. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addMarshallerMetricsConsumer(MarshallerMetricsConsumer consumer)Adds a consumer of  MarshallerMetricsthat is associated with the current render. | 
| void | checkTimeout()Check the timeout and throw an XhtmlTimeoutException if the timeout is expired. | 
| void | disableAsyncRenderSafe()Mark the content rendered in this context as non-async-render-safe | 
| ContentTree | getContentTree()If multiple items are being converted in this 'context' then the complete tree of ContentNodes will be retrieved
 via this method. | 
| @Nullable ContentEntityObject | getEntity()Get the current ContentEntityObject for this context. | 
| Set<MarshallerMetricsConsumer> | getMarshallerMetricsConsumers()Returns the consumers of  MarshallerMetricsthat are associated with the current render. | 
| String | getOutputDeviceType()Note, that if you want your code to be compatible with versions of Confluence older then 4.3.2 then you can
 instead call  getPropertyAsString(String)with the parameter "output-device-type". | 
| @NonNull String | getOutputType() | 
| PageContext | getPageContext()Deprecated. 
 since 7.5.0, use  getRenderContext()instead. | 
| Object | getProperty(String name)Return a property from the context. | 
| Object | getProperty(String name,
           Object defaultValue)Return a property from the context or the supplied defaultValue if the property does
 not exist on the context. | 
| String | getPropertyAsString(String name)Returns the property for this key as a String. | 
| default com.atlassian.renderer.RenderContext | getRenderContext() | 
| String | getSpaceKey()The spacekey for the current context if applicable or null otherwise. | 
| default @Nullable PageTemplate | getTemplate() | 
| com.atlassian.util.concurrent.Timeout | getTimeout()Deprecated. 
 since 7.0.1. Use  timeout() | 
| boolean | hasProperty(String name)Returns true if the property with the specified key has been set. | 
| boolean | isAsyncRenderSafe() | 
| boolean | isDiffOrEmail()Check if the current context is  ConversionContextOutputType.DIFForConversionContextOutputType.EMAIL | 
| boolean | removeMarshallerMetricsConsumer(MarshallerMetricsConsumer consumer)Removes a consumer of  MarshallerMetricsthat is associated with the current render. | 
| Object | removeProperty(String name)Removes the property references by the key from the conversion context and returns it. | 
| void | setProperty(String name,
           Object value)Sets the property specified by name in the conversion context. | 
| default io.atlassian.util.concurrent.Timeout | timeout()The Timeout object for this Conversion. | 
static final String IS_VALIDATING_COMMENT
void setProperty(String name, Object value)
name - A unique key for this property. See ConversionContextPropertyName for common names.value - The value of the property.@Deprecated PageContext getPageContext()
getRenderContext() instead.DefaultConversionContextdefault com.atlassian.renderer.RenderContext getRenderContext()
Object removeProperty(String name)
name - The unique key of the property. See ConversionContextPropertyName for common names.Object getProperty(String name)
name - of the property. See ConversionContextPropertyName for common names.Object getProperty(String name, Object defaultValue)
name - the name of the propertydefaultValue - the default value to return if the property is not found.String getPropertyAsString(String name)
toString() will be called if this is not the java.lang.String class.
null will be returned if this property does not exist.
name - The key for the propertyboolean hasProperty(String name)
name - The name of the propertyContentTree getContentTree()
String getOutputDeviceType()
getPropertyAsString(String) with the parameter "output-device-type". For example, if you
 are a plugin developer writing a macro that can target different device types such as mobile, you can
 retain a common code base for your mobile and non-mobile implementations by avoiding this method and
 calling getPropertyAsString("output-device-type") instead.ConversionContextOutputDeviceType.DESKTOP
 but plugins that have their own renderer could use other types@NonNull String getOutputType()
ConversionContextOutputType.value() which indicates the target output type
 for the conversion.boolean isAsyncRenderSafe()
void disableAsyncRenderSafe()
@Nullable ContentEntityObject getEntity()
default @Nullable PageTemplate getTemplate()
String getSpaceKey()
@Deprecated com.atlassian.util.concurrent.Timeout getTimeout()
timeout()Timeout.isExpired(), or how much longer conversion should be allowed to
 run using Timeout.getTime(), Timeout.getUnit().default io.atlassian.util.concurrent.Timeout timeout()
Timeout.isExpired(), or how much longer conversion should be allowed to
 run using Timeout.getTime(), Timeout.getUnit().void checkTimeout()
           throws XhtmlTimeoutException
timeout() and Timeout.isExpired() to check the timeout without
 throwing an exception.XhtmlTimeoutException - if the conversion has exceeded its time limit.boolean isDiffOrEmail()
ConversionContextOutputType.DIFF
 or ConversionContextOutputType.EMAILvoid addMarshallerMetricsConsumer(MarshallerMetricsConsumer consumer)
MarshallerMetrics
 that is associated with the current render. These consumers are used instead of event listeners because their
 scope of interest is limited to a particular thread.boolean removeMarshallerMetricsConsumer(MarshallerMetricsConsumer consumer)
MarshallerMetrics
 that is associated with the current render.Set<MarshallerMetricsConsumer> getMarshallerMetricsConsumers()
MarshallerMetrics
 that are associated with the current render. These consumers are used instead of event listeners because their
 scope of interest is limited to a particular thread.Copyright © 2003–2021 Atlassian. All rights reserved.