com.atlassian.velocity.htmlsafe
Class HtmlAnnotationEscaper
java.lang.Object
com.atlassian.velocity.htmlsafe.introspection.AnnotatedReferenceHandler
com.atlassian.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:
- Those ending in "html"
- xHtmlContent
- body
| Nested classes/interfaces inherited from interface org.apache.velocity.app.event.ReferenceInsertionEventHandler |
org.apache.velocity.app.event.ReferenceInsertionEventHandler.referenceInsertExecutor |
|
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 |
protected boolean |
shouldEscape(java.lang.String referenceName,
java.lang.Object value,
java.util.Collection<java.lang.annotation.Annotation> annotations)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HtmlAnnotationEscaper
public HtmlAnnotationEscaper()
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 insertedvalue - unboxed reference valueannotations - any annotations associated with the reference
- Returns:
- Final value to insert
shouldEscape
protected boolean shouldEscape(java.lang.String referenceName,
java.lang.Object value,
java.util.Collection<java.lang.annotation.Annotation> annotations)
Copyright © 2013 Atlassian. All Rights Reserved.