Save This Page
Home » hibernate-entity-src-20081106 » org.hibernate » ejb » packaging » [javadoc | source]
org.hibernate.ejb.packaging
abstract public class: JarVisitor [javadoc | source]
java.lang.Object
   org.hibernate.ejb.packaging.JarVisitor

Direct Known Subclasses:
    FileZippedJarVisitor, ExplodedJarVisitor, JarProtocolVisitor, AbstractJarVisitor, InputStreamZippedJarVisitor

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:
abstract public static class  JarVisitor.Filter  Filter used when searching elements in a JAR 
abstract public static class  JarVisitor.FileFilter  Filter use to match a file by its name 
abstract public 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. 
abstract public static class  JarVisitor.ClassFilter  Filter on class elements 
abstract public static class  JarVisitor.PackageFilter  Filter on pachage element 
public static class  JarVisitor.Entry  Represent a JAR entry Contains a name and an optional Input stream to the entry 
Field Summary
protected  String unqualifiedJarName     
protected  URL jarUrl     
Constructor:
 protected JarVisitor(String fileName,
    JarVisitor.Filter[] filters) 
 protected JarVisitor(URL url,
    JarVisitor.Filter[] filters) 
Method from org.hibernate.ejb.packaging.JarVisitor Summary:
addElement,   doProcessElements,   getFilters,   getJarURLFromURLEntry,   getMatchingEntries,   getUnqualifiedJarName,   getVisitor,   getVisitor,   unqualify
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.hibernate.ejb.packaging.JarVisitor Detail:
 protected final  void addElement(String entryName,
    InputStream is,
    InputStream secondIs) throws IOException 
 abstract protected  void doProcessElements() throws IOException
 public JarVisitor.Filter[] getFilters() 
 public static final URL getJarURLFromURLEntry(URL url,
    String entry) throws IllegalArgumentException 
    Get the JAR URL of the JAR containing the given entry
 public final Set[] getMatchingEntries() throws IOException 
    Return the matching entries for each filter in the same order the filter where passed
 public String getUnqualifiedJarName() 
    Get the unqualified Jar name (ie wo path and wo extension)
 public static final JarVisitor getVisitor(URL jarUrl,
    JarVisitor.Filter[] filters) throws IllegalArgumentException 
    Build a JarVisitor on the given JAR URL applying th given filters
 public static final JarVisitor getVisitor(String jarPath,
    JarVisitor.Filter[] filters) throws IllegalArgumentException 
    Get a JarVisitor to the jar jarPath applying the given filters
 protected  void unqualify()