com.atlassian.confluence.velocity.htmlsafe
Class PossibleIncorrectHtmlEncodingEventHandler

java.lang.Object
  extended by com.atlassian.confluence.velocity.introspection.AnnotatedReferenceHandler
      extended by 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 Class Summary
 
Nested classes/interfaces inherited from interface org.apache.velocity.app.event.ReferenceInsertionEventHandler
org.apache.velocity.app.event.ReferenceInsertionEventHandler.referenceInsertExecutor
 
Constructor Summary
PossibleIncorrectHtmlEncodingEventHandler()
           
 
Method Summary
protected  java.lang.Object annotatedValueInsert(java.lang.String referenceName, java.lang.Object value, java.util.Collection<java.lang.annotation.Annotation> annotations)
          Process a reference with a collection of annotations
static boolean isLoggingEnabled()
           
 void setContext(org.apache.velocity.context.Context context)
           
 
Methods inherited from class com.atlassian.confluence.velocity.introspection.AnnotatedReferenceHandler
referenceInsert
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PossibleIncorrectHtmlEncodingEventHandler

public PossibleIncorrectHtmlEncodingEventHandler()
Method Detail

isLoggingEnabled

public static boolean isLoggingEnabled()

annotatedValueInsert

protected java.lang.Object annotatedValueInsert(java.lang.String referenceName,
                                                java.lang.Object value,
                                                java.util.Collection<java.lang.annotation.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 inserted
value - unboxed reference value
annotations - 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


Copyright © 2003-2014 Atlassian. All Rights Reserved.