com.atlassian.confluence.velocity.htmlsafe
Class HtmlAnnotationEscaper

java.lang.Object
  extended by com.atlassian.confluence.velocity.introspection.AnnotatedReferenceHandler
      extended by com.atlassian.confluence.velocity.htmlsafe.HtmlAnnotationEscaper
All Implemented Interfaces:
org.apache.velocity.app.event.EventHandler, org.apache.velocity.app.event.ReferenceInsertionEventHandler

public class HtmlAnnotationEscaper
extends AnnotatedReferenceHandler

A ReferenceInsertionEventHandler that HTML encodes any value not annotated as being HtmlSafe. It also excludes some references from escaping based on name:


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.velocity.app.event.ReferenceInsertionEventHandler
org.apache.velocity.app.event.ReferenceInsertionEventHandler.referenceInsertExecutor
 
Constructor Summary
HtmlAnnotationEscaper()
           
 
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
 
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

HtmlAnnotationEscaper

public HtmlAnnotationEscaper()
Method Detail

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


Copyright © 2003-2014 Atlassian. All Rights Reserved.