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:
  • Constructor Details

  • Method Details

    • 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() and cleanBody(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), see isBodyCleaned() and cleanBody(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 (see BodyType). When changing the body type to a different one or to null, the body will be marked as dirty (not AntiSamy'ed), see isBodyCleaned() and cleanBody(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
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • clone

      public Object clone()
      Overrides:
      clone in class Object