org.webframe.support.util
Class ClassUtils

java.lang.Object
  extended by org.springframework.util.ClassUtils
      extended by org.webframe.support.util.ClassUtils

public class ClassUtils
extends org.springframework.util.ClassUtils

提供class类文件与jar包的相关联系操作方法;

Version:
$Id: codetemplates.xml,v 1.1 2009/09/07 08:48:12 Exp $ Create: 2011-4-7 上午09:23:35
Author:
黄国庆

Field Summary
private static org.apache.commons.logging.Log log
           
 
Fields inherited from class org.springframework.util.ClassUtils
ARRAY_SUFFIX, CGLIB_CLASS_SEPARATOR, CLASS_FILE_SUFFIX
 
Constructor Summary
ClassUtils()
           
 
Method Summary
static org.springframework.core.io.Resource getClassesRootResource(Class<?> clazz)
          如果clazz在jar包中,返回null;否则返回clazz所在的classes的根目录
static org.springframework.core.io.Resource getResource(Class<?> clazz)
          获取指定class文件Resource
static boolean isInJar(Class<?> clazz)
          指定的class文件是否存在jar包中,true or false;捕获IOException异常,返回false。
static boolean isInJar(org.springframework.core.io.Resource resource)
          指定Resource是否存在jar包中,true or false;捕获IOException异常,返回false。
 
Methods inherited from class org.springframework.util.ClassUtils
addResourcePathToPackagePath, classNamesToString, classNamesToString, classPackageAsResourcePath, convertClassNameToResourcePath, convertResourcePathToClassName, createCompositeInterface, forName, forName, getAllInterfaces, getAllInterfacesAsSet, getAllInterfacesForClass, getAllInterfacesForClass, getAllInterfacesForClassAsSet, getAllInterfacesForClassAsSet, getClassFileName, getConstructorIfAvailable, getDefaultClassLoader, getDescriptiveType, getMethod, getMethodCountForName, getMethodIfAvailable, getMostSpecificMethod, getPackageName, getQualifiedMethodName, getQualifiedName, getShortName, getShortName, getShortNameAsProperty, getStaticMethod, getUserClass, getUserClass, hasAtLeastOneMethodWithName, hasConstructor, hasMethod, isAssignable, isAssignableValue, isCacheSafe, isCglibProxy, isCglibProxyClass, isCglibProxyClassName, isPresent, isPresent, isPrimitiveArray, isPrimitiveOrWrapper, isPrimitiveWrapper, isPrimitiveWrapperArray, isVisible, matchesTypeName, overrideThreadContextClassLoader, resolveClassName, resolvePrimitiveClassName, resolvePrimitiveIfNecessary, toClassArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log
Constructor Detail

ClassUtils

public ClassUtils()
Method Detail

isInJar

public static boolean isInJar(Class<?> clazz)
指定的class文件是否存在jar包中,true or false;捕获IOException异常,返回false。

Parameters:
clazz -
Returns:

isInJar

public static boolean isInJar(org.springframework.core.io.Resource resource)
指定Resource是否存在jar包中,true or false;捕获IOException异常,返回false。

Parameters:
resource -
Returns:

getResource

public static org.springframework.core.io.Resource getResource(Class<?> clazz)
获取指定class文件Resource

Parameters:
clazz -
Returns:

getClassesRootResource

public static org.springframework.core.io.Resource getClassesRootResource(Class<?> clazz)
如果clazz在jar包中,返回null;否则返回clazz所在的classes的根目录

Parameters:
clazz -
Returns:


Copyright © 2012. All Rights Reserved.