当前位置: 首页>>代码示例>>Java>>正文


Java ICodeBaseIterator类代码示例

本文整理汇总了Java中edu.umd.cs.findbugs.classfile.ICodeBaseIterator的典型用法代码示例。如果您正苦于以下问题:Java ICodeBaseIterator类的具体用法?Java ICodeBaseIterator怎么用?Java ICodeBaseIterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ICodeBaseIterator类属于edu.umd.cs.findbugs.classfile包,在下文中一共展示了ICodeBaseIterator类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: iterator

import edu.umd.cs.findbugs.classfile.ICodeBaseIterator; //导入依赖的package包/类
public ICodeBaseIterator iterator() throws InterruptedException {
    if (codeBase instanceof IScannableCodeBase) {
        return ((IScannableCodeBase) codeBase).iterator();
    } else {
        return new ICodeBaseIterator() {
            @Override
            public boolean hasNext() throws InterruptedException {
                return false;
            }

            @Override
            public ICodeBaseEntry next() throws InterruptedException {
                throw new UnsupportedOperationException();
            }
        };
    }
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:18,代码来源:ClassPathBuilder.java

示例2: iterator

import edu.umd.cs.findbugs.classfile.ICodeBaseIterator; //导入依赖的package包/类
@Override
public ICodeBaseIterator iterator() throws InterruptedException {
    final Iterator<NSFCodeBaseEntry> itNSBE = m_Classes.values().iterator();
    return new ICodeBaseIterator() {

        @Override
        public ICodeBaseEntry next() throws InterruptedException {
            return itNSBE.next();
        }

        @Override
        public boolean hasNext() throws InterruptedException {
            return itNSBE.hasNext();
        }
    };
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:17,代码来源:NSFCodeBase.java

示例3: iterator

import edu.umd.cs.findbugs.classfile.ICodeBaseIterator; //导入依赖的package包/类
public ICodeBaseIterator iterator() throws InterruptedException {
    if (codeBase instanceof IScannableCodeBase) {
        return ((IScannableCodeBase) codeBase).iterator();
    } else {
        return new ICodeBaseIterator() {
            public boolean hasNext() throws InterruptedException {
                return false;
            }

            public ICodeBaseEntry next() throws InterruptedException {
                throw new UnsupportedOperationException();
            }
        };
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:16,代码来源:ClassPathBuilder.java

示例4: scanCodebase

import edu.umd.cs.findbugs.classfile.ICodeBaseIterator; //导入依赖的package包/类
/**
 * Scan given codebase in order to
 * <ul>
 * <li>check the codebase for nested archives (adding any found to the
 * worklist)
 * <li>build a list of class resources found in the codebase
 * </ul>
 * 
 * @param workList
 *            the worklist
 * @param discoveredCodeBase
 *            the codebase to scan
 * @throws InterruptedException
 */
private void scanCodebase(IClassPath classPath, LinkedList<WorkListItem> workList, DiscoveredCodeBase discoveredCodeBase)
        throws InterruptedException {
    if (DEBUG) {
        System.out.println("Scanning " + discoveredCodeBase.getCodeBase().getCodeBaseLocator());
    }

    IScannableCodeBase codeBase = (IScannableCodeBase) discoveredCodeBase.getCodeBase();

    ICodeBaseIterator i = codeBase.iterator();
    while (i.hasNext()) {
        ICodeBaseEntry entry = i.next();
        if (VERBOSE) {
            System.out.println("Entry: " + entry.getResourceName());
        }

        if (!NO_PARSE_CLASS_NAMES && codeBase.isApplicationCodeBase()
                && DescriptorFactory.isClassResource(entry.getResourceName()) && !(entry instanceof SingleFileCodeBaseEntry)) {
            parseClassName(entry);
        }

        // Note the resource exists in this codebase
        discoveredCodeBase.addCodeBaseEntry(entry);

        // If resource is a nested archive, add it to the worklist
        if (scanNestedArchives && codeBase.isApplicationCodeBase() && Archive.isArchiveFileName(entry.getResourceName())) {
            if (VERBOSE) {
                System.out.println("Entry is an archive!");
            }
            ICodeBaseLocator nestedArchiveLocator = classFactory.createNestedArchiveCodeBaseLocator(codeBase,
                    entry.getResourceName());
            addToWorkList(workList,
                    new WorkListItem(nestedArchiveLocator, codeBase.isApplicationCodeBase(), ICodeBase.NESTED));
        }
    }
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:50,代码来源:ClassPathBuilder.java

示例5: iterator

import edu.umd.cs.findbugs.classfile.ICodeBaseIterator; //导入依赖的package包/类
public ICodeBaseIterator iterator() throws InterruptedException {
    if (!searchPerformed) {
        rfs.search();
        searchPerformed = true;
    }

    return new DirectoryCodeBaseIterator();
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:9,代码来源:DirectoryCodeBase.java

示例6: iterator

import edu.umd.cs.findbugs.classfile.ICodeBaseIterator; //导入依赖的package包/类
public ICodeBaseIterator iterator() throws InterruptedException {
    return new ICodeBaseIterator() {
        boolean done = false;

        /*
         * (non-Javadoc)
         * 
         * @see edu.umd.cs.findbugs.classfile.ICodeBaseIterator#hasNext()
         */
        public boolean hasNext() throws InterruptedException {
            return !done;
        }

        /*
         * (non-Javadoc)
         * 
         * @see edu.umd.cs.findbugs.classfile.ICodeBaseIterator#next()
         */
        public ICodeBaseEntry next() throws InterruptedException {
            if (done) {
                throw new NoSuchElementException();
            }
            done = true;
            return new SingleFileCodeBaseEntry(SingleFileCodeBase.this);
        }
    };
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:28,代码来源:SingleFileCodeBase.java

示例7: scanCodebase

import edu.umd.cs.findbugs.classfile.ICodeBaseIterator; //导入依赖的package包/类
/**
 * Scan given codebase in order to
 * <ul>
 * <li>check the codebase for nested archives (adding any found to the
 * worklist)
 * <li>build a list of class resources found in the codebase
 * </ul>
 *
 * @param workList
 *            the worklist
 * @param discoveredCodeBase
 *            the codebase to scan
 * @throws InterruptedException
 */
private void scanCodebase(IClassPath classPath, LinkedList<WorkListItem> workList, DiscoveredCodeBase discoveredCodeBase)
        throws InterruptedException {
    if (DEBUG) {
        System.out.println("Scanning " + discoveredCodeBase.getCodeBase().getCodeBaseLocator());
    }

    IScannableCodeBase codeBase = (IScannableCodeBase) discoveredCodeBase.getCodeBase();

    ICodeBaseIterator i = codeBase.iterator();
    while (i.hasNext()) {
        ICodeBaseEntry entry = i.next();
        if (VERBOSE) {
            System.out.println("Entry: " + entry.getResourceName());
        }

        if (!NO_PARSE_CLASS_NAMES && codeBase.isApplicationCodeBase()
                && DescriptorFactory.isClassResource(entry.getResourceName()) && !(entry instanceof SingleFileCodeBaseEntry)) {
            parseClassName(entry);
        }

        // Note the resource exists in this codebase
        discoveredCodeBase.addCodeBaseEntry(entry);

        // If resource is a nested archive, add it to the worklist
        if (scanNestedArchives && (codeBase.isApplicationCodeBase() || codeBase instanceof DirectoryCodeBase)
                && Archive.isLibraryFileName(entry.getResourceName())) {
            if (VERBOSE) {
                System.out.println("Entry is an library!");
            }
            ICodeBaseLocator nestedArchiveLocator = classFactory.createNestedArchiveCodeBaseLocator(codeBase,
                    entry.getResourceName());
            addToWorkList(workList, new WorkListItem(nestedArchiveLocator, codeBase.isApplicationCodeBase(),
                    ICodeBase.Discovered.NESTED));
        }
    }
}
 
开发者ID:OpenNTF,项目名称:FindBug-for-Domino-Designer,代码行数:51,代码来源:ClassPathBuilder.java

示例8: iterator

import edu.umd.cs.findbugs.classfile.ICodeBaseIterator; //导入依赖的package包/类
public ICodeBaseIterator iterator() {
    return new MyIterator();
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:4,代码来源:ZipInputStreamCodeBase.java

示例9: iterator

import edu.umd.cs.findbugs.classfile.ICodeBaseIterator; //导入依赖的package包/类
public ICodeBaseIterator iterator() throws InterruptedException {
    return new DelegatingCodeBaseIterator(this, delegateCodeBase);
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:4,代码来源:NestedZipFileCodeBase.java

示例10: iterator

import edu.umd.cs.findbugs.classfile.ICodeBaseIterator; //导入依赖的package包/类
public ICodeBaseIterator iterator() {
    final Enumeration<? extends ZipEntry> zipEntryEnumerator = zipFile.entries();

    return new ICodeBaseIterator() {
        ZipFileCodeBaseEntry nextEntry;

        public boolean hasNext() {
            scanForNextEntry();
            return nextEntry != null;
        }

        /*
         * (non-Javadoc)
         *
         * @see edu.umd.cs.findbugs.classfile.ICodeBaseIterator#next()
         */
        public ICodeBaseEntry next() throws InterruptedException {
            scanForNextEntry();
            if (nextEntry == null) {
                throw new NoSuchElementException();
            }
            ICodeBaseEntry result = nextEntry;
            nextEntry = null;
            return result;
        }

        private void scanForNextEntry() {
            while (nextEntry == null) {
                if (!zipEntryEnumerator.hasMoreElements()) {
                    return;
                }

                ZipEntry zipEntry = zipEntryEnumerator.nextElement();

                if (!zipEntry.isDirectory()) {
                    addLastModifiedTime(zipEntry.getTime());
                    nextEntry = new ZipFileCodeBaseEntry(ZipFileCodeBase.this, zipEntry);
                    break;
                }
            }
        }

    };
}
 
开发者ID:ytus,项目名称:findbugs-all-the-bugs,代码行数:45,代码来源:ZipFileCodeBase.java


注:本文中的edu.umd.cs.findbugs.classfile.ICodeBaseIterator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。