diff options
Diffstat (limited to 'jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/finder/acceptor/JarMatchingAcceptor.java')
-rw-r--r-- | jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/finder/acceptor/JarMatchingAcceptor.java | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/finder/acceptor/JarMatchingAcceptor.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/finder/acceptor/JarMatchingAcceptor.java deleted file mode 100644 index 7742d75f7..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/common/internal/finder/acceptor/JarMatchingAcceptor.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.eclipse.jst.jsf.common.internal.finder.acceptor; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jst.jsf.common.JSFCommonPlugin; -import org.eclipse.jst.jsf.common.internal.finder.AbstractMatcher.AlwaysMatcher; -import org.eclipse.jst.jsf.common.internal.finder.VisitorMatcher; -import org.eclipse.jst.jsf.common.internal.finder.VisitorMatcher.MatchingAcceptor; -import org.eclipse.jst.jsf.common.internal.resource.ClasspathJarFile; -import org.eclipse.jst.jsf.common.internal.resource.JavaCoreMediator; - -/** - * A matching acceptor that provides the jars referenced by a project. - * - * @author cbateman - * - */ -public class JarMatchingAcceptor extends - MatchingAcceptor<IProject, ClasspathJarFile> -{ - private final JavaCoreMediator _javaCoreMediator; - - /** - * @param javaCoreMediator - */ - public JarMatchingAcceptor(final JavaCoreMediator javaCoreMediator) - { - _javaCoreMediator = javaCoreMediator; - } - - @Override - protected Collection<ClasspathJarFile> getInputChildren( - final IProject project) - { - final IJavaProject javaProject = _javaCoreMediator.create(project); - IPackageFragmentRoot[] roots = null; - try - { - roots = javaProject.getPackageFragmentRoots(); - } catch (final JavaModelException e1) - { - JSFCommonPlugin.log(e1); - } - if (roots == null || roots.length == 0) - { - return Collections.EMPTY_LIST; - } - final List<ClasspathJarFile> jars = new ArrayList<ClasspathJarFile>(); - VisitorMatcher<IPackageFragmentRoot, ClasspathJarFile, String> entryMatcher = new VisitorMatcher<IPackageFragmentRoot, ClasspathJarFile, String>( - "", "", new ClasspathEntryJarMatchingAcceptor(project), //$NON-NLS-1$ //$NON-NLS-2$ - Collections.singletonList(new AlwaysMatcher())); - for (final IPackageFragmentRoot root : roots) - { - try - { - jars.addAll(entryMatcher.perform(root)); - } catch (Exception e) - { - JSFCommonPlugin.log(e); - } - } - return jars; - } - - @Override - protected Collection<ClasspathJarFile> getVisitableChildren( - final ClasspathJarFile visitType) - { - return Collections.EMPTY_LIST; - } -} |