org.apache.felix.scrplugin.tags.annotation
Class Util

java.lang.Object
  extended by org.apache.felix.scrplugin.tags.annotation.Util

public abstract class Util
extends Object

Helper class for getting values from annotations.


Constructor Summary
Util()
           
 
Method Summary
static String[] getAnnotationValues(com.thoughtworks.qdox.model.Annotation annotation, String name, JavaClassDescription desc)
           
static boolean getBooleanValue(com.thoughtworks.qdox.model.Annotation annotation, String name, Class<?> clazz)
          Get a boolean value from an annotation.
static boolean[] getBooleanValues(com.thoughtworks.qdox.model.Annotation annotation, JavaClassDescription desc, String name)
          Helper method to get the values of an annotation as boolean values.
static byte[] getByteValues(com.thoughtworks.qdox.model.Annotation annotation, JavaClassDescription desc, String name)
          Helper method to get the values of an annotation as byte values.
static char[] getCharValues(com.thoughtworks.qdox.model.Annotation annotation, JavaClassDescription desc, String name)
          Helper method to get the values of an annotation as char values.
static Class<?> getClassValue(com.thoughtworks.qdox.model.Annotation annotation, String name, Class<?> clazz)
           
static double[] getDoubleValues(com.thoughtworks.qdox.model.Annotation annotation, JavaClassDescription desc, String name)
          Helper method to get the values of an annotation as double values.
static
<T extends Enum<T>>
T
getEnumValue(com.thoughtworks.qdox.model.Annotation annotation, String name, Class<T> enumClass, Class<?> clazz)
           
static
<T extends Enum<T>>
T
getEnumValue(com.thoughtworks.qdox.model.Annotation annotation, String name, Class<T> enumClass, Class<?> clazz, boolean returnDefault)
           
static float[] getFloatValues(com.thoughtworks.qdox.model.Annotation annotation, JavaClassDescription desc, String name)
          Helper method to get the values of an annotation as float values.
static int getIntValue(com.thoughtworks.qdox.model.Annotation annotation, String name, Class<?> clazz)
           
static int[] getIntValues(com.thoughtworks.qdox.model.Annotation annotation, JavaClassDescription desc, String name)
          Helper method to get the values of an annotation as long values.
static long[] getLongValues(com.thoughtworks.qdox.model.Annotation annotation, JavaClassDescription desc, String name)
          Helper method to get the values of an annotation as long values.
static short[] getShortValues(com.thoughtworks.qdox.model.Annotation annotation, JavaClassDescription desc, String name)
          Helper method to get the values of an annotation as short values.
static String getStringValue(com.thoughtworks.qdox.model.Annotation annotation, JavaClassDescription desc, String name, Class<?> clazz)
          Get a single annotation value
static String[] getStringValues(com.thoughtworks.qdox.model.Annotation annotation, JavaClassDescription desc, String name)
          Helper method to get the values of an annotation as string values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

getBooleanValue

public static boolean getBooleanValue(com.thoughtworks.qdox.model.Annotation annotation,
                                      String name,
                                      Class<?> clazz)
Get a boolean value from an annotation.

Parameters:
annotation - The annotation.
name - The name of the attribute.
clazz - The annotation class.
Returns:
The boolean value.

getIntValue

public static int getIntValue(com.thoughtworks.qdox.model.Annotation annotation,
                              String name,
                              Class<?> clazz)

getStringValues

public static String[] getStringValues(com.thoughtworks.qdox.model.Annotation annotation,
                                       JavaClassDescription desc,
                                       String name)
Helper method to get the values of an annotation as string values.

Parameters:
annotation - The annotation.
desc - The java class description.
name - The attribute name from the annotation.
Returns:
The array of string values or null.

getLongValues

public static long[] getLongValues(com.thoughtworks.qdox.model.Annotation annotation,
                                   JavaClassDescription desc,
                                   String name)
Helper method to get the values of an annotation as long values.

Parameters:
annotation - The annotation.
desc - The java class description.
name - The attribute name from the annotation.
Returns:
The array of long values or null.

getIntValues

public static int[] getIntValues(com.thoughtworks.qdox.model.Annotation annotation,
                                 JavaClassDescription desc,
                                 String name)
Helper method to get the values of an annotation as long values.

Parameters:
annotation - The annotation.
desc - The java class description.
name - The attribute name from the annotation.
Returns:
The array of long values or null.

getFloatValues

public static float[] getFloatValues(com.thoughtworks.qdox.model.Annotation annotation,
                                     JavaClassDescription desc,
                                     String name)
Helper method to get the values of an annotation as float values.

Parameters:
annotation - The annotation.
desc - The java class description.
name - The attribute name from the annotation.
Returns:
The array of float values or null.

getDoubleValues

public static double[] getDoubleValues(com.thoughtworks.qdox.model.Annotation annotation,
                                       JavaClassDescription desc,
                                       String name)
Helper method to get the values of an annotation as double values.

Parameters:
annotation - The annotation.
desc - The java class description.
name - The attribute name from the annotation.
Returns:
The array of double values or null.

getCharValues

public static char[] getCharValues(com.thoughtworks.qdox.model.Annotation annotation,
                                   JavaClassDescription desc,
                                   String name)
Helper method to get the values of an annotation as char values.

Parameters:
annotation - The annotation.
desc - The java class description.
name - The attribute name from the annotation.
Returns:
The array of char values or null.

getShortValues

public static short[] getShortValues(com.thoughtworks.qdox.model.Annotation annotation,
                                     JavaClassDescription desc,
                                     String name)
Helper method to get the values of an annotation as short values.

Parameters:
annotation - The annotation.
desc - The java class description.
name - The attribute name from the annotation.
Returns:
The array of short values or null.

getByteValues

public static byte[] getByteValues(com.thoughtworks.qdox.model.Annotation annotation,
                                   JavaClassDescription desc,
                                   String name)
Helper method to get the values of an annotation as byte values.

Parameters:
annotation - The annotation.
desc - The java class description.
name - The attribute name from the annotation.
Returns:
The array of byte values or null.

getBooleanValues

public static boolean[] getBooleanValues(com.thoughtworks.qdox.model.Annotation annotation,
                                         JavaClassDescription desc,
                                         String name)
Helper method to get the values of an annotation as boolean values.

Parameters:
annotation - The annotation.
desc - The java class description.
name - The attribute name from the annotation.
Returns:
The array of boolean values or null.

getStringValue

public static String getStringValue(com.thoughtworks.qdox.model.Annotation annotation,
                                    JavaClassDescription desc,
                                    String name,
                                    Class<?> clazz)
Get a single annotation value

Parameters:
annotation - The annotation
desc - The class description
name - The name of the annotation
clazz - The class of the annotation
Returns:
The value

getClassValue

public static Class<?> getClassValue(com.thoughtworks.qdox.model.Annotation annotation,
                                     String name,
                                     Class<?> clazz)

getEnumValue

public static <T extends Enum<T>> T getEnumValue(com.thoughtworks.qdox.model.Annotation annotation,
                                                 String name,
                                                 Class<T> enumClass,
                                                 Class<?> clazz,
                                                 boolean returnDefault)

getEnumValue

public static <T extends Enum<T>> T getEnumValue(com.thoughtworks.qdox.model.Annotation annotation,
                                                 String name,
                                                 Class<T> enumClass,
                                                 Class<?> clazz)

getAnnotationValues

public static String[] getAnnotationValues(com.thoughtworks.qdox.model.Annotation annotation,
                                           String name,
                                           JavaClassDescription desc)
                                    throws IllegalArgumentException
Throws:
IllegalArgumentException


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.