|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConversionContext
Field Summary | |
---|---|
static java.lang.String |
IS_VALIDATING_COMMENT
This property will be set when validating a comment. |
Method Summary | |
---|---|
void |
checkTimeout()
Check the timeout and throw an XhtmlTimeoutException if the timeout is expired. |
ContentTree |
getContentTree()
If multiple items are being converted in this 'context' then the complete tree of ContentNodes will be retrieved via this method. |
ContentEntityObject |
getEntity()
Get the current ContentEntityObject for this context. |
java.lang.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". |
java.lang.String |
getOutputType()
|
PageContext |
getPageContext()
This method should be considered almost deprecated. |
java.lang.Object |
getProperty(java.lang.String name)
Return a property from the context. |
java.lang.Object |
getProperty(java.lang.String name,
java.lang.Object defaultValue)
Return a property from the context or the supplied defaultValue if the property does not exist on the context. |
java.lang.String |
getPropertyAsString(java.lang.String name)
Returns the property for this key as a String. |
java.lang.String |
getSpaceKey()
The spacekey for the current context if applicable or null otherwise. |
com.atlassian.util.concurrent.Timeout |
getTimeout()
The Timeout object for this Conversion. |
boolean |
hasProperty(java.lang.String name)
Returns true if the property with the specified key has been set. |
java.lang.Object |
removeProperty(java.lang.String name)
Removes the property references by the key from the conversion context and returns it. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Sets the property specified by name in the conversion context. |
Field Detail |
---|
static final java.lang.String IS_VALIDATING_COMMENT
Method Detail |
---|
void setProperty(java.lang.String name, java.lang.Object value)
name
- A unique key for this property. See ConversionContextPropertyName
for common names.value
- The value of the property.PageContext getPageContext()
This method should be considered almost deprecated.
At the moment a ConversionContext implementation will always be wrapping at least a RenderContext
and as long as this is actually a PageContext
then it will be returned by this method.
However, at some point in the future ConversionContext will be decoupled from the old v2 RenderContext
and this method will be removed.
DefaultConversionContext
java.lang.Object removeProperty(java.lang.String name)
name
- The unique key of the property. See ConversionContextPropertyName
for common names.
java.lang.Object getProperty(java.lang.String name)
name
- of the property. See ConversionContextPropertyName
for common names.
java.lang.Object getProperty(java.lang.String name, java.lang.Object defaultValue)
name
- the name of the propertydefaultValue
- the default value to return if the property is not found.
java.lang.String getPropertyAsString(java.lang.String name)
name
- The key for the property
boolean hasProperty(java.lang.String name)
name
- The name of the property
ContentTree getContentTree()
java.lang.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 typesjava.lang.String getOutputType()
ConversionContextOutputType.value()
which indicates the target output type
for the conversion.ContentEntityObject getEntity()
java.lang.String getSpaceKey()
com.atlassian.util.concurrent.Timeout getTimeout()
Timeout.isExpired()
, or how much longer conversion should be allowed to
run using Timeout.getTime()
, Timeout.getUnit()
.
void checkTimeout() throws XhtmlTimeoutException
getTimeout()
and Timeout.isExpired()
to check the timeout without
throwing an exception.
XhtmlTimeoutException
- if the conversion has exceeded its time limit.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |