public class Reflections extends Object
Modifier and Type | Field and Description |
---|---|
static Annotation[] |
EMPTY_ANNOTATIONS |
static Class<?>[] |
EMPTY_CLASSES |
static Type[] |
EMPTY_TYPES |
Constructor and Description |
---|
Reflections() |
Modifier and Type | Method and Description |
---|---|
static Map<Class<?>,Type> |
buildTypeMap(Set<Type> types) |
static <T> T |
cast(Object obj) |
static boolean |
containsWildcards(Type[] types) |
static Type[] |
getActualTypeArguments(Type type)
Gets the actual type arguments of a Type
|
static int |
getNesting(Class<?> clazz) |
static Object |
getNonPrivateFinalMethodOrType(Class<?> type) |
static String |
getPropertyName(Method method)
Gets the property name from a getter method.
|
static <T> Class<T> |
getRawType(Type type) |
static boolean |
isAbstract(Method method)
Checks if a method is abstract
|
static boolean |
isArrayType(Class<?> rawType)
Checks if raw type is array type
|
static boolean |
isAssignableFrom(Set<Type> types1,
Set<Type> types2)
Check the assiginability of a set of flattened types.
|
static boolean |
isAssignableFrom(Set<Type> types1,
Type type2)
Check the assiginability of a set of flattened types.
|
static boolean |
isAssignableFrom(Type[] types1,
Type type2) |
static boolean |
isAssignableFrom(Type type1,
Set<? extends Type> types2) |
static boolean |
isAssignableFrom(Type type1,
Type type2) |
static boolean |
isAssignableFrom(Type type1,
Type[] types2) |
static boolean |
isAssignableTo(Type type1,
Type[] types2) |
static boolean |
isBindings(Annotation binding)
Deprecated.
|
static boolean |
isCacheable(Annotation[] annotations) |
static boolean |
isCacheable(Set<Annotation> annotations) |
static boolean |
isClassLoadable(String className,
org.jboss.weld.resources.spi.ResourceLoader resourceLoader) |
static boolean |
isFinal(Class<?> clazz)
Checks if class is final
|
static boolean |
isFinal(Member member)
Checks if member is final
|
static boolean |
isNonStaticInnerClass(Class<?> clazz) |
static boolean |
isPackagePrivate(int mod) |
static boolean |
isParamerterizedTypeWithWildcard(Class<?> type) |
static boolean |
isParameterizedType(Class<?> type)
Checks if type is parameterized type
|
static boolean |
isPrimitive(Type type) |
static boolean |
isPrivate(Member member)
Checks if member is private
|
static boolean |
isSerializable(Class<?> clazz) |
static boolean |
isStatic(Class<?> type)
Checks if type is static
|
static boolean |
isStatic(Member member)
Checks if member is static
|
static boolean |
isTransient(Member member) |
static boolean |
isTypeInsideBounds(Type type,
Type[] lowerBounds,
Type[] upperBounds) |
static boolean |
isTypeOrAnyMethodFinal(Class<?> type)
Checks if type or member is final
|
static boolean |
matches(Set<Type> requiredTypes,
Set<Type> beanTypes)
Check whether whether any of the requiredTypes matches a type in beanTypes
|
static boolean |
matches(Type requiredType,
Set<? extends Type> beanTypes) |
static boolean |
matches(Type requiredType,
Type beanType) |
public static final Type[] EMPTY_TYPES
public static final Annotation[] EMPTY_ANNOTATIONS
public static final Class<?>[] EMPTY_CLASSES
public static boolean isCacheable(Set<Annotation> annotations)
public static boolean isCacheable(Annotation[] annotations)
public static <T> T cast(Object obj)
public static String getPropertyName(Method method)
method
- The getter methodpublic static boolean isFinal(Class<?> clazz)
clazz
- The class to checkpublic static int getNesting(Class<?> clazz)
public static boolean isNonStaticInnerClass(Class<?> clazz)
public static boolean isFinal(Member member)
member
- The member to checkpublic static boolean isPrivate(Member member)
member
- The member to checkpublic static boolean isTypeOrAnyMethodFinal(Class<?> type)
type
- Type or memberpublic static boolean isPackagePrivate(int mod)
public static boolean isStatic(Class<?> type)
type
- Type to checkpublic static boolean isStatic(Member member)
member
- Member to checkpublic static boolean isTransient(Member member)
public static boolean isAbstract(Method method)
method
- the methodpublic static Type[] getActualTypeArguments(Type type)
type
- The type to examinepublic static boolean isArrayType(Class<?> rawType)
rawType
- The raw type to checkpublic static boolean isParameterizedType(Class<?> type)
type
- The type to checkpublic static boolean isParamerterizedTypeWithWildcard(Class<?> type)
public static boolean containsWildcards(Type[] types)
@Deprecated public static boolean isBindings(Annotation binding)
binding
- The binding type to checkpublic static boolean isTypeInsideBounds(Type type, Type[] lowerBounds, Type[] upperBounds)
public static boolean isAssignableFrom(Set<Type> types1, Set<Type> types2)
types1
- the types1types2
- the type2public static boolean matches(Set<Type> requiredTypes, Set<Type> beanTypes)
requiredTypes
- the requiredTypesbeanTypes
- the beanTypespublic static boolean isAssignableFrom(Set<Type> types1, Type type2)
types1
- the types1type2
- the type2public static boolean isSerializable(Class<?> clazz)
public static boolean isPrimitive(Type type)
public static boolean isClassLoadable(String className, org.jboss.weld.resources.spi.ResourceLoader resourceLoader)
Copyright © 2013 Seam Framework. All rights reserved.