org.hibernate.ejb.packaging
Class AbstractJarVisitor

java.lang.Object
  extended by org.hibernate.ejb.packaging.AbstractJarVisitor
All Implemented Interfaces:
JarVisitor
Direct Known Subclasses:
ExplodedJarVisitor, FileZippedJarVisitor, InputStreamZippedJarVisitor

public abstract class AbstractJarVisitor
extends Object
implements 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


Field Summary
protected  boolean done
           
protected  URL jarUrl
           
protected  String unqualifiedJarName
           
 
Constructor Summary
protected AbstractJarVisitor(String fileName, Filter[] filters)
           
protected AbstractJarVisitor(URL url, Filter[] filters)
           
 
Method Summary
protected  void addElement(String entryName, InputStream is, InputStream secondIs)
           
protected abstract  void doProcessElements()
           
 Filter[] getFilters()
           
 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)
protected  void unqualify()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

unqualifiedJarName

protected String unqualifiedJarName

jarUrl

protected URL jarUrl

done

protected boolean done
Constructor Detail

AbstractJarVisitor

protected AbstractJarVisitor(String fileName,
                             Filter[] filters)

AbstractJarVisitor

protected AbstractJarVisitor(URL url,
                             Filter[] filters)
Method Detail

unqualify

protected void unqualify()

getUnqualifiedJarName

public String getUnqualifiedJarName()
Get the unqualified Jar name (ie wo path and wo extension)

Specified by:
getUnqualifiedJarName in interface JarVisitor
Returns:
the unqualified jar name.

getFilters

public Filter[] getFilters()
Specified by:
getFilters in interface JarVisitor

getMatchingEntries

public Set[] getMatchingEntries()
                         throws IOException
Return the matching entries for each filter in the same order the filter where passed

Specified by:
getMatchingEntries in interface JarVisitor
Returns:
array of Set of JarVisitor.Entry
Throws:
IOException - if something went wrong

doProcessElements

protected abstract void doProcessElements()
                                   throws IOException
Throws:
IOException

addElement

protected final void addElement(String entryName,
                                InputStream is,
                                InputStream secondIs)
                         throws IOException
Throws:
IOException


Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.