Package com.atlassian.confluence.core
Class BodyContent
java.lang.Object
com.atlassian.confluence.core.BodyContent
- All Implemented Interfaces:
Serializable,Cloneable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBodyContent(BodyContent orig) BodyContent(ContentEntityObject content, String body, BodyType bodyType) -
Method Summary
Modifier and TypeMethodDescriptioncleanBody(ContentCleaner cleaner) Cleans the stored body (marking it as such), and returns it.cleanBody(ContentCleaner cleaner, String cleanerVersion) Cleans the stored body, marks it as cleaned (in-memory and persistently via the supplied version token), and returns it.clone()booleangetBody()Returns the persisted version token of the cleaner config that last sanitized this body, or null if it has never been cleaned with a tracked version.longgetId()Hibernate IDinthashCode()booleanvoidSets the new body for this object.voidsetBodyCleanedVersion(String bodyCleanedVersion) voidsetBodyType(BodyType bodyType) Changes the body type for this object.voidsetContent(ContentEntityObject content) voidsetId(long id) Hibernate IDvoidshallowCopy(BodyContent orig) Does a shallow copy of object orig.
-
Constructor Details
-
BodyContent
public BodyContent() -
BodyContent
-
BodyContent
-
-
Method Details
-
shallowCopy
Does a shallow copy of object orig. Hibernate ID is not copied. -
getBody
- Returns:
- the current body for this object. This body could be dirty (not AntiSamy'ed), see
isBodyCleaned()andcleanBody(com.atlassian.confluence.content.ContentCleaner)
-
setBody
Sets the new body for this object. This body will be marked as dirty (not AntiSamy'ed), seeisBodyCleaned()andcleanBody(com.atlassian.confluence.content.ContentCleaner) -
getBodyType
-
setBodyType
Changes the body type for this object. Type could be RAW or XHTML (seeBodyType). When changing the body type to a different one or to null, the body will be marked as dirty (not AntiSamy'ed), seeisBodyCleaned()andcleanBody(com.atlassian.confluence.content.ContentCleaner) -
getId
public long getId()Hibernate ID -
setId
public void setId(long id) Hibernate ID -
getContent
-
setContent
-
isBodyCleaned
public boolean isBodyCleaned()- Returns:
- true if the body has been "cleaned", this is, if AntiSamy has been called on this object's body.
Used on
XhtmlCleaningInterceptor.cleanBodyContents(Object, String[], Object[])} to check if we've already cleaned this object's body
-
getBodyCleanedVersion
Returns the persisted version token of the cleaner config that last sanitized this body, or null if it has never been cleaned with a tracked version. SeeStorageFormatCleanerVersion. -
setBodyCleanedVersion
-
cleanBody
Cleans the stored body, marks it as cleaned (in-memory and persistently via the supplied version token), and returns it.- Parameters:
cleaner- clean() will be called with the current bodycleanerVersion- the version token to persist, representing the current cleaner config- Returns:
- the cleaned body
-
cleanBody
Cleans the stored body (marking it as such), and returns it. UsecleanBody(ContentCleaner, String)to also persist the cleaner version.- Parameters:
cleaner- clean() will be called on this object with the current body passed to it- Returns:
- the cleaned body
-
equals
-
hashCode
public int hashCode() -
clone
-