com.atlassian.velocity.htmlsafe
Class HtmlSafeAnnotationUtils

java.lang.Object
  extended by com.atlassian.velocity.htmlsafe.HtmlSafeAnnotationUtils

public final class HtmlSafeAnnotationUtils
extends java.lang.Object

Utilities for working with the HtmlSafe annotation


Field Summary
static java.lang.annotation.Annotation HTML_SAFE_ANNOTATION
           
static java.util.Set<java.lang.annotation.Annotation> HTML_SAFE_ANNOTATION_COLLECTION
           
 
Method Summary
static boolean containsAnnotationOfType(java.util.Collection<java.lang.annotation.Annotation> annotations, java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Detects whether a collection contains an annotation of a particular type
static boolean endsWithHtmlIgnoreCase(java.lang.String name)
          Detects whether or not a symbol ends with "HTML", regardless of case.
static boolean hasHtmlSafeToStringMethod(java.lang.Object value)
          Return true if the object has a toString method that has been annotated as HtmlSafe
static boolean isHtmlSafeValue(AnnotationBoxedElement<?> value)
          Determines whether an annotated value is htmlsafe (i.e should not be encoded during rendering)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTML_SAFE_ANNOTATION

public static final java.lang.annotation.Annotation HTML_SAFE_ANNOTATION

HTML_SAFE_ANNOTATION_COLLECTION

public static final java.util.Set<java.lang.annotation.Annotation> HTML_SAFE_ANNOTATION_COLLECTION
Method Detail

hasHtmlSafeToStringMethod

public static boolean hasHtmlSafeToStringMethod(java.lang.Object value)
Return true if the object has a toString method that has been annotated as HtmlSafe

Parameters:
value - Object to query
Returns:
true if HTML safe

isHtmlSafeValue

public static boolean isHtmlSafeValue(AnnotationBoxedElement<?> value)
Determines whether an annotated value is htmlsafe (i.e should not be encoded during rendering)

Parameters:
value - Object to query
Returns:
true if HTML safe

containsAnnotationOfType

public static boolean containsAnnotationOfType(java.util.Collection<java.lang.annotation.Annotation> annotations,
                                               java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Detects whether a collection contains an annotation of a particular type

Parameters:
annotations - Collection to scan
annotationType - Annotation type to detect
Returns:
true if annotation type is found

endsWithHtmlIgnoreCase

public static boolean endsWithHtmlIgnoreCase(java.lang.String name)
Detects whether or not a symbol ends with "HTML", regardless of case.

Parameters:
name - the name to be examined
Returns:
true if the name ended with "HTML", ignoring case


Copyright © 2013 Atlassian. All Rights Reserved.