org.jboss.resteasy.cdi
Class Utils

java.lang.Object
  extended by org.jboss.resteasy.cdi.Utils

public class Utils
extends Object

Utility methods for detecting CDI scopes and JAX-RS components

Author:
Jozef Hartinger

Constructor Summary
Utils()
           
 
Method Summary
static boolean isJaxrsAnnotatedClass(Class<?> clazz)
          Finds out if a given class is decorated with JAX-RS annotations.
static boolean isJaxrsComponent(Class<?> clazz)
          Find out if a given class is a JAX-RS component
static boolean isJaxrsResource(Class<?> clazz)
          Returns true if and only if the given class is a JAX-RS root resource or a sub-resource.
static boolean isScopeDefined(Class<?> clazz, javax.enterprise.inject.spi.BeanManager manager)
          Find out if a given class has is explicitly bound to a scope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

isJaxrsAnnotatedClass

public static boolean isJaxrsAnnotatedClass(Class<?> clazz)
Finds out if a given class is decorated with JAX-RS annotations. Interfaces of the class are not scanned for JAX-RS annotations.

Parameters:
clazz -
Returns:
true if a given interface has @Path annotation or if any of its methods is decorated with @Path annotation or a request method designator.

isJaxrsResource

public static boolean isJaxrsResource(Class<?> clazz)
Returns true if and only if the given class is a JAX-RS root resource or a sub-resource. The class itself as well as its interfaces are scanned for JAX-RS annotations.


isJaxrsComponent

public static boolean isJaxrsComponent(Class<?> clazz)
Find out if a given class is a JAX-RS component

Returns:
true if and only if a give class is a JAX-RS resource, provider or javax.ws.rs.core.Application subclass.

isScopeDefined

public static boolean isScopeDefined(Class<?> clazz,
                                     javax.enterprise.inject.spi.BeanManager manager)
Find out if a given class has is explicitly bound to a scope.

Returns:
true if and only if a given class is annotated with a scope annotation or with a stereotype which (transitively) declares a scope


Copyright © 2012. All Rights Reserved.