|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hibernate.ejb.packaging.JarVisitor
public abstract class JarVisitor
Parse a JAR of any form (zip file, exploded directory, ...) apply a set of filters (File filter, Class filter, Package filter) and return the appropriate matching sets of elements
Nested Class Summary | |
---|---|
static class |
JarVisitor.ClassFilter
Filter on class elements |
static class |
JarVisitor.Entry
Represent a JAR entry Contains a name and an optional Input stream to the entry |
static class |
JarVisitor.FileFilter
Filter use to match a file by its name |
static class |
JarVisitor.Filter
Filter used when searching elements in a JAR |
static class |
JarVisitor.JavaElementFilter
Filter a Java element (class or package per fully qualified name and annotation existence) At least 1 annotation has to annotate the element and the accept method must match If none annotations are passed, only the accept method must pass. |
static class |
JarVisitor.PackageFilter
Filter on pachage element |
Field Summary | |
---|---|
protected URL |
jarUrl
|
protected String |
unqualifiedJarName
|
Constructor Summary | |
---|---|
protected |
JarVisitor(String fileName,
JarVisitor.Filter[] filters)
|
protected |
JarVisitor(URL url,
JarVisitor.Filter[] filters)
|
Method Summary | |
---|---|
protected void |
addElement(String entryName,
InputStream is,
InputStream secondIs)
|
protected abstract void |
doProcessElements()
|
JarVisitor.Filter[] |
getFilters()
|
static URL |
getJarURLFromURLEntry(URL url,
String entry)
Get the JAR URL of the JAR containing the given entry |
Set[] |
getMatchingEntries()
Return the matching entries for each filter in the same order the filter where passed |
String |
getUnqualifiedJarName()
Get the unqualified Jar name (ie wo path and wo extension) |
static JarVisitor |
getVisitor(String jarPath,
JarVisitor.Filter[] filters)
Get a JarVisitor to the jar jarPath applying the given filters |
static JarVisitor |
getVisitor(URL jarUrl,
JarVisitor.Filter[] filters)
Build a JarVisitor on the given JAR URL applying th given filters |
protected void |
unqualify()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String unqualifiedJarName
protected URL jarUrl
Constructor Detail |
---|
protected JarVisitor(String fileName, JarVisitor.Filter[] filters)
protected JarVisitor(URL url, JarVisitor.Filter[] filters)
Method Detail |
---|
public static final URL getJarURLFromURLEntry(URL url, String entry) throws IllegalArgumentException
url
- entry
-
IllegalArgumentException
- if none URL is foundpublic static final JarVisitor getVisitor(URL jarUrl, JarVisitor.Filter[] filters) throws IllegalArgumentException
IllegalArgumentException
- if the URL is malformedpublic static final JarVisitor getVisitor(String jarPath, JarVisitor.Filter[] filters) throws IllegalArgumentException
jarPath
applying the given filters
IllegalArgumentException
- if the jarPath is incorrectprotected void unqualify()
public String getUnqualifiedJarName()
public JarVisitor.Filter[] getFilters()
public final Set[] getMatchingEntries() throws IOException
IOException
- if something went wrongprotected abstract void doProcessElements() throws IOException
IOException
protected final void addElement(String entryName, InputStream is, InputStream secondIs) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |