JAXBUtils.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:wso2-axis2 作者:
/**
 * @param list
 * @param pkg
 */
private static void checkClasses(List<Class> list, String pkg) {
    // The installed classfinder or directory search may inadvertently add too many 
    // classes.  This rountine is a 'double check' to make sure that the classes
    // are acceptable.
    for (int i=0; i<list.size();) {
        Class cls = list.get(i);
        if (!cls.isInterface() && 
                (cls.isEnum() ||
                 getAnnotation(cls, XmlType.class) != null ||
                 ClassUtils.getDefaultPublicConstructor(cls) != null) &&
            !ClassUtils.isJAXWSClass(cls) &&
            !isSkipClass(cls) &&
            cls.getPackage().getName().equals(pkg)) {
            i++; // Acceptable class
        } else {
            if (log.isDebugEnabled()) {
                log.debug("Removing class " + cls + " from consideration because it is not in package " + pkg +
                          " or is an interface or does not have a public constructor or is" +
                          " a jaxws class");
            }
            list.remove(i);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号