com.atlassian.confluence.util.classpath
Class ClasspathClasses

java.lang.Object
  extended by com.atlassian.confluence.util.classpath.ClasspathClasses
All Implemented Interfaces:
java.lang.Iterable<java.lang.String>

public class ClasspathClasses
extends java.lang.Object
implements java.lang.Iterable<java.lang.String>

Classes on the classpath and the JARs that contain them.


Constructor Summary
ClasspathClasses()
           
 
Method Summary
 void add(java.net.URL jarUrl, java.lang.String classFileName)
          Associates a class with a JAR.
 void addAll(java.net.URL jarUrl, java.util.Collection<java.lang.String> classFileNames)
          Associates all the given classes with a JAR.
 JarSet getJarsForClass(java.lang.String classFileName)
          Returns a set of JAR URLs which contain a given class.
 java.util.SortedMap<java.lang.String,java.util.Set<java.net.URL>> getJarUrlsByClass()
           
 java.util.Iterator<java.lang.String> iterator()
          Returns an iterator over the class files on the classpath.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClasspathClasses

public ClasspathClasses()
Method Detail

add

public void add(java.net.URL jarUrl,
                java.lang.String classFileName)
Associates a class with a JAR.

Parameters:
jarUrl - the URL of a JAR on the classpath
classFileName - the name of a class file in the JAR, in the form "java/lang/String.class"

addAll

public void addAll(java.net.URL jarUrl,
                   java.util.Collection<java.lang.String> classFileNames)
Associates all the given classes with a JAR.

Parameters:
jarUrl - the URL of a JAR on the classpath
classFileNames - the class file names in the JAR, in the form "java/lang/String.class"

iterator

public java.util.Iterator<java.lang.String> iterator()
Returns an iterator over the class files on the classpath. Each is a String in the form "java/lang/String.class".

Specified by:
iterator in interface java.lang.Iterable<java.lang.String>

size

public int size()

getJarsForClass

public JarSet getJarsForClass(java.lang.String classFileName)
Returns a set of JAR URLs which contain a given class.

Parameters:
classFileName - the name of the class file, in the form "java/lang/String.class".
Returns:
the set of JAR URLs containing the class, or an empty set if the class isn't found.

getJarUrlsByClass

public java.util.SortedMap<java.lang.String,java.util.Set<java.net.URL>> getJarUrlsByClass()


Copyright © 2003-2014 Atlassian. All Rights Reserved.