Home » apache-openwebbeans-1.0.0-incubating-M3-sources » org.apache.webbeans.util » [javadoc | source]
org.apache.webbeans.util
public final class: ClassUtil [javadoc | source]
java.lang.Object
   org.apache.webbeans.util.ClassUtil
Utility classes with respect to the class operations.
Field Summary
public static final  Map<?, Object> PRIMITIVE_CLASS_DEFAULT_VALUES     
public static final  Set<?> VALUE_TYPES     
public static final  Map<?> PRIMITIVE_TO_WRAPPERS_MAP     
public static final  String WEBBEANS_DATE_FORMAT     
Method from org.apache.webbeans.util.ClassUtil Summary:
callInstanceMethod,   checkEqual,   checkForTypeArguments,   checkParametrizedType,   classHasFieldWithName,   classHasMoreThanOneFieldWithName,   defaultJavaValues,   getActualTypeArguements,   getActualTypeArguements,   getClass,   getClassFromName,   getClassMethodWithTypes,   getClassMethodsWithTypes,   getClazz,   getConstructors,   getDeclaredMethods,   getFieldWithAnnotation,   getFieldWithName,   getFirstRawType,   getGenericSuperClassTypeArguments,   getGenericSuperInterfacesTypeArguments,   getMethodParameterTypes,   getObjectMethodNames,   getPackage,   getPrimitiveWrapper,   getRawTypeForInjectionPoint,   getReturnType,   getRootException,   getSuperClasses,   getTypeVariables,   getWrapperPrimitive,   hasFinalMethod,   isAbstract,   isArray,   isAssignable,   isAssignable,   isAssignableForParametrized,   isConcrete,   isContaintNoArgConstructor,   isDefaultConstructorExist,   isDefinitionConstainsTypeVariables,   isEnum,   isFinal,   isFirstParametricTypeArgGeneric,   isInValueTypes,   isInnerClazz,   isInterface,   isMethodExistWithName,   isMethodHasCheckedException,   isMethodHasException,   isMethodHasParameter,   isMoreThanOneMethodWithName,   isObjectMethod,   isParametrizedType,   isPrimitive,   isPrimitiveWrapper,   isPrivate,   isPublic,   isPublic,   isStatic,   isTypeVariable,   isUnboundedTypeVariable,   isValueOkForBigDecimalOrInteger,   isValueOkForCalendar,   isValueOkForDate,   isValueOkForEnum,   isValueOkForPrimitiveOrWrapper,   isWildCardType,   setClassTypeHierarchy,   setField,   setInterfaceTypeHierarchy,   setTypeHierarchy
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.webbeans.util.ClassUtil Detail:
 public static Object callInstanceMethod(Method method,
    Object instance,
    Object[] args) 
    Call method on the instance with given arguments.
 public static boolean checkEqual(TypeVariable<?>[] variables,
    Type[] types) 
    Check the parametrized type actual arguments equals with the class type variables at the injection point.
 public static boolean checkForTypeArguments(Class<?> src,
    Type[] typeArguments,
    Class<?> target) 
 public static boolean checkParametrizedType(ParameterizedType pType) 
    Return true if it does not contain type variable for wildcard type false otherwise.
 public static boolean classHasFieldWithName(Class<?> clazz,
    String fieldName) 
 public static boolean classHasMoreThanOneFieldWithName(Class<?> clazz,
    String fieldName) 
 public static T defaultJavaValues(Class<T> clazz) 
    Gets the Java Standart Class default value.
 public static Type[] getActualTypeArguements(Class<?> clazz) 
 public static Type[] getActualTypeArguements(Type type) 
 public static Class<?> getClass(Type type) 
    Gets the class of the given type arguments.

    If the given type Type parameters is an instance of the ParameterizedType , it returns the raw type otherwise it return the casted Class of the type argument.

 public static Class<?> getClassFromName(String name) 
 public static Method getClassMethodWithTypes(Class<?> clazz,
    String methodName,
    List<?> parameterTypes) 
 public static List<Method> getClassMethodsWithTypes(Class<?> clazz,
    String methodName,
    List<?> parameterTypes) 
 public static Class<?> getClazz(Type type) 
    Return raw class type for given type.
 public static Constructor<T>[] getConstructors(Class<T> clazz) 
    Returns class constructor array.
 public static Method[] getDeclaredMethods(Class<?> clazz) 
    Gets the declared methods of the given class.
 public static Field getFieldWithAnnotation(Class<?> clazz,
    Class<Annotation> annotation) 
 public static Field getFieldWithName(Class<?> clazz,
    String fieldName) 
 public static Class<?> getFirstRawType(Type type) 
 public static Type[] getGenericSuperClassTypeArguments(Class<?> clazz) 
 public static List<Type> getGenericSuperInterfacesTypeArguments(Class<?> clazz) 
 public static Class<?>[] getMethodParameterTypes(Method method) 
 public static List<String> getObjectMethodNames() 
 public Package getPackage(String packageName) 
    Gets java package if exist.
 public static Class<?> getPrimitiveWrapper(Class<?> clazz) 
 public static Class<?> getRawTypeForInjectionPoint(InjectionPoint injectionPoint) 
    Returns injection point raw type.
 public static Class<?> getReturnType(Method method) 
    Gets the return type of the method.
 public static Throwable getRootException(Throwable throwable) 
 public static List<?> getSuperClasses(Class<?> clazz,
    List<?> list) 
 public static TypeVariable<?>[] getTypeVariables(Class<?> clazz) 
 public static Class<?> getWrapperPrimitive(Class<?> clazz) 
 public static boolean hasFinalMethod(Class<?> clazz) 
    Check for class that has a final method or not.
 public static boolean isAbstract(Integer modifier) 
    Check abstract modifier.
 public static boolean isArray(Class<?> clazz) 
 public static boolean isAssignable(Type beanType,
    Type requiredType) 
 public static boolean isAssignable(Class<?> lhs,
    Class<?> rhs) 
    Returns true if rhs is assignable type to the lhs, false otherwise.
 public static boolean isAssignableForParametrized(ParameterizedType beanType,
    ParameterizedType requiredType) 
    Returns true if given bean's api type is injectable to injection point required type.
 public static boolean isConcrete(Class<?> clazz) 
    Returna true if the class is not abstract and interface.
 public static Constructor<T> isContaintNoArgConstructor(Class<T> clazz) 
 public static boolean isDefaultConstructorExist(Class<T> clazz) 
    Returns true if class has a default constructor.
 public static boolean isDefinitionConstainsTypeVariables(Class<?> clazz) 
 public static boolean isEnum(Class<?> clazz) 
 public static boolean isFinal(Integer modifier) 
    Check final modifier.
 public static boolean isFirstParametricTypeArgGeneric(ParameterizedType type) 
 public static boolean isInValueTypes(Class<?> clazz) 
 public static boolean isInnerClazz(Class<?> clazz) 
    Check the class is inner or not
 public static boolean isInterface(Integer modifier) 
    Check interface modifier.
 public static boolean isMethodExistWithName(Class<?> clazz,
    String methodName) 
 public static boolean isMethodHasCheckedException(Method method) 
    Check method throws checked exception or not.
 public static boolean isMethodHasException(Method method) 
    Check method throws Exception or not.
 public static boolean isMethodHasParameter(Method method) 
    Check that method has any formal arguments.
 public static boolean isMoreThanOneMethodWithName(String methodName,
    Class<?> clazz) 
 public static boolean isObjectMethod(String methodName) 
 public static boolean isParametrizedType(Type type) 
    Returns true if type is an instance of ParameterizedType else otherwise.
 public static boolean isPrimitive(Class<?> clazz) 
 public static boolean isPrimitiveWrapper(Class<?> clazz) 
 public static boolean isPrivate(Integer modifier) 
    Check the modifier contains static keyword.
 public static boolean isPublic(Integer modifier) 
    Check the modifier contains static keyword.
 public static boolean isPublic(int modifs) 
    Check the modifiers contains the public keyword.
 public static boolean isStatic(Integer modifier) 
    Check the modifier contains static keyword.
 public static boolean isTypeVariable(Type type) 
    Returns true if type is an instance of TypeVariable else otherwise.
 public static boolean isUnboundedTypeVariable(Type type) 
 public static Object isValueOkForBigDecimalOrInteger(Class<?> type,
    String value) 
 public static Calendar isValueOkForCalendar(String value) throws ParseException 
 public static Date isValueOkForDate(String value) throws ParseException 
 public static Enum isValueOkForEnum(Class clazz,
    String value) 
 public static Object isValueOkForPrimitiveOrWrapper(Class<?> type,
    String value) 
    Gets the primitive/wrapper value of the parsed String parameter.
 public static boolean isWildCardType(Type type) 
    Returns true if type is an instance of WildcardType else otherwise.
 public static Set<Type> setClassTypeHierarchy(Set<Type> set,
    Class<?> clazz) 
 public static  void setField(Object instance,
    Field field,
    Object value) 
 public static Set<Type> setInterfaceTypeHierarchy(Set<Type> set,
    Class<?> clazz) 
 public static Set<Type> setTypeHierarchy(Set<Type> set,
    Type clazz)