Package com.atlassian.confluence.core
Class BodyContent
- java.lang.Object
-
- com.atlassian.confluence.core.BodyContent
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class BodyContent extends Object implements Cloneable, Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BodyContent()
BodyContent(BodyContent orig)
BodyContent(ContentEntityObject content, String body, BodyType bodyType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
cleanBody(ContentCleaner cleaner)
Cleans the stored body (marking it as such), and returns it.Object
clone()
boolean
equals(Object o)
String
getBody()
BodyType
getBodyType()
ContentEntityObject
getContent()
long
getId()
Hibernate IDint
hashCode()
boolean
isBodyCleaned()
void
setBody(String body)
Sets the new body for this object.void
setBodyType(BodyType bodyType)
Changes the body type for this object.void
setContent(ContentEntityObject content)
void
setId(long id)
Hibernate IDvoid
shallowCopy(BodyContent orig)
Does a shallow copy of object orig.
-
-
-
Constructor Detail
-
BodyContent
public BodyContent()
-
BodyContent
public BodyContent(BodyContent orig)
-
BodyContent
public BodyContent(ContentEntityObject content, String body, BodyType bodyType)
-
-
Method Detail
-
shallowCopy
public void shallowCopy(BodyContent orig)
Does a shallow copy of object orig. Hibernate ID is not copied.
-
getBody
public String 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
public void setBody(String body)
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
public BodyType getBodyType()
-
setBodyType
public void setBodyType(BodyType bodyType)
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
public ContentEntityObject getContent()
-
setContent
public void setContent(ContentEntityObject content)
-
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
-
cleanBody
public String cleanBody(ContentCleaner cleaner)
Cleans the stored body (marking it as such), and returns it.- Parameters:
cleaner
- clean() will be called on this object with the current body passed to it- Returns:
- the cleaned body
-
-