com.atlassian.confluence.velocity.introspection
Class AnnotatedValue

java.lang.Object
  extended by com.atlassian.confluence.velocity.introspection.AnnotatedValue
All Implemented Interfaces:
AnnotationBoxedElement, BoxedValue, BoxingStrategy, java.lang.reflect.AnnotatedElement

public final class AnnotatedValue
extends java.lang.Object
implements AnnotationBoxedElement

An annotated value associates a collection of annotations with a value.


Constructor Summary
AnnotatedValue(java.lang.Object value, java.util.Collection<java.lang.annotation.Annotation> annotations)
          Construct a new annotated value.
 
Method Summary
 java.lang.Object box(java.lang.Object value)
          This will box another object with the same annotations as this value.
 boolean equals(java.lang.Object o)
           
<T extends java.lang.annotation.Annotation>
T
getAnnotation(java.lang.Class<T> tClass)
           
 java.lang.annotation.Annotation[] getAnnotations()
           
 java.util.Collection<java.lang.annotation.Annotation> getCollectionInheritableAnnotations()
           
 java.lang.annotation.Annotation[] getDeclaredAnnotations()
           
 java.lang.String getDescription()
           
 int hashCode()
           
 boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> aClass)
           
 java.lang.String toString()
          Delegates and returns the result of calling toString on the boxed value.
 java.lang.Object unbox()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnnotatedValue

public AnnotatedValue(java.lang.Object value,
                      java.util.Collection<java.lang.annotation.Annotation> annotations)
Construct a new annotated value. THe iteration order of annotations may not be preserved.

Parameters:
value - The value to annotate
annotations - This values annotations.
Method Detail

isAnnotationPresent

public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> aClass)
Specified by:
isAnnotationPresent in interface java.lang.reflect.AnnotatedElement

getAnnotation

public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> tClass)
Specified by:
getAnnotation in interface java.lang.reflect.AnnotatedElement

getAnnotations

public java.lang.annotation.Annotation[] getAnnotations()
Specified by:
getAnnotations in interface java.lang.reflect.AnnotatedElement

getDeclaredAnnotations

public java.lang.annotation.Annotation[] getDeclaredAnnotations()
Specified by:
getDeclaredAnnotations in interface java.lang.reflect.AnnotatedElement

unbox

public java.lang.Object unbox()
Specified by:
unbox in interface BoxedValue

box

public java.lang.Object box(java.lang.Object value)
This will box another object with the same annotations as this value.

Specified by:
box in interface BoxingStrategy
Parameters:
value - Value to box
Returns:
Value boxed with the annotations

getCollectionInheritableAnnotations

public java.util.Collection<java.lang.annotation.Annotation> getCollectionInheritableAnnotations()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getDescription

public final java.lang.String getDescription()

toString

public java.lang.String toString()
Delegates and returns the result of calling toString on the boxed value. This is unpleasant but necessary as Velocity uses the toString() result when context values are used as part of directive arguments.

Overrides:
toString in class java.lang.Object
Returns:
String representation of wrapped value


Copyright © 2003-2014 Atlassian. All Rights Reserved.