com.atlassian.confluence.velocity.htmlsafe
Class PossibleIncorrectHtmlEncodingEventHandler
java.lang.Object
com.atlassian.confluence.velocity.introspection.AnnotatedReferenceHandler
com.atlassian.confluence.velocity.htmlsafe.PossibleIncorrectHtmlEncodingEventHandler
- All Implemented Interfaces:
- org.apache.velocity.app.event.EventHandler, org.apache.velocity.app.event.ReferenceInsertionEventHandler, org.apache.velocity.util.ContextAware
public final class PossibleIncorrectHtmlEncodingEventHandler
- extends AnnotatedReferenceHandler
- implements org.apache.velocity.util.ContextAware
Reference insertion handler to be used before the HtmlAnnotationEscaper
.
This handler will log warnings whenever a value that hasn't been marked as HtmlSafe contains data that looks like HTML.
As this handler is ContextAware
it is not thread safe and should not be reused across multiple threads.
Nested classes/interfaces inherited from interface org.apache.velocity.app.event.ReferenceInsertionEventHandler |
org.apache.velocity.app.event.ReferenceInsertionEventHandler.referenceInsertExecutor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PossibleIncorrectHtmlEncodingEventHandler
public PossibleIncorrectHtmlEncodingEventHandler()
isLoggingEnabled
public static boolean isLoggingEnabled()
annotatedValueInsert
protected Object annotatedValueInsert(String referenceName,
Object value,
Collection<Annotation> annotations)
- Description copied from class:
AnnotatedReferenceHandler
- Process a reference with a collection of annotations
- Specified by:
annotatedValueInsert
in class AnnotatedReferenceHandler
- Parameters:
referenceName
- name of the reference being insertedvalue
- unboxed reference valueannotations
- any annotations associated with the reference
- Returns:
- Final value to insert
setContext
public void setContext(org.apache.velocity.context.Context context)
- Specified by:
setContext
in interface org.apache.velocity.util.ContextAware