Class XhtmlCleaningInterceptor
- java.lang.Object
-
- org.hibernate.EmptyInterceptor
-
- com.atlassian.confluence.content.render.xhtml.storage.XhtmlCleaningInterceptor
-
- All Implemented Interfaces:
Serializable
,org.hibernate.Interceptor
@ReturnValuesAreNullableByDefault public class XhtmlCleaningInterceptor extends org.hibernate.EmptyInterceptor
A Hibernate interceptor that will silently cleanup security issues with XHTML content on saving to the database.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XhtmlCleaningInterceptor(StorageFormatCleaner storageFormatCleaner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, org.hibernate.type.Type[] types)
When a BodyContent is being modified ensure that the body of the entity is safe XHTML.boolean
onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, org.hibernate.type.Type[] types)
boolean
onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, org.hibernate.type.Type[] types)
If a BodyContent entity is being saved, then ensure the body of the entity is safe XHTML.-
Methods inherited from class org.hibernate.EmptyInterceptor
afterTransactionBegin, afterTransactionCompletion, beforeTransactionCompletion, findDirty, getEntity, getEntityName, instantiate, isTransient, onCollectionRecreate, onCollectionRemove, onCollectionUpdate, onDelete, onPrepareStatement, postFlush, preFlush
-
-
-
-
Constructor Detail
-
XhtmlCleaningInterceptor
public XhtmlCleaningInterceptor(StorageFormatCleaner storageFormatCleaner)
-
-
Method Detail
-
onFlushDirty
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, org.hibernate.type.Type[] types) throws org.hibernate.CallbackException
When a BodyContent is being modified ensure that the body of the entity is safe XHTML.- Specified by:
onFlushDirty
in interfaceorg.hibernate.Interceptor
- Overrides:
onFlushDirty
in classorg.hibernate.EmptyInterceptor
- Throws:
org.hibernate.CallbackException
-
onSave
public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, org.hibernate.type.Type[] types) throws org.hibernate.CallbackException
If a BodyContent entity is being saved, then ensure the body of the entity is safe XHTML.- Specified by:
onSave
in interfaceorg.hibernate.Interceptor
- Overrides:
onSave
in classorg.hibernate.EmptyInterceptor
- Throws:
org.hibernate.CallbackException
-
onLoad
public boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, org.hibernate.type.Type[] types) throws org.hibernate.CallbackException
- Specified by:
onLoad
in interfaceorg.hibernate.Interceptor
- Overrides:
onLoad
in classorg.hibernate.EmptyInterceptor
- Throws:
org.hibernate.CallbackException
-
-