com.atlassian.confluence.core
Class BodyContent

java.lang.Object
  extended by com.atlassian.confluence.core.BodyContent
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class BodyContent
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

See Also:
Serialized Form

Constructor Summary
BodyContent()
           
BodyContent(BodyContent orig)
           
BodyContent(ContentEntityObject content, java.lang.String body, BodyType bodyType)
           
 
Method Summary
 java.lang.String cleanBody(ContentCleaner cleaner)
          Cleans the stored body (marking it as such), and returns it.
 java.lang.Object clone()
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getBody()
           
 BodyType getBodyType()
           
 ContentEntityObject getContent()
           
 long getId()
          Hibernate ID
 int hashCode()
           
 boolean isBodyCleaned()
           
 void setBody(java.lang.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 ID
 void shallowCopy(BodyContent orig)
          Does a shallow copy of object orig.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BodyContent

public BodyContent()

BodyContent

public BodyContent(BodyContent orig)

BodyContent

public BodyContent(ContentEntityObject content,
                   java.lang.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 java.lang.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(java.lang.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 java.lang.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(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException


Copyright © 2003-2014 Atlassian. All Rights Reserved.