com.sun.enterprise.tools.verifier.apiscan.classfile
Class ClosureCompilerImplBase

java.lang.Object
  extended by com.sun.enterprise.tools.verifier.apiscan.classfile.ClosureCompilerImplBase
All Implemented Interfaces:
ClosureCompiler
Direct Known Subclasses:
BCELClosureCompilerImpl

public abstract class ClosureCompilerImplBase
extends Object
implements ClosureCompiler

This is the base class for classes that actually implement ClosureCompiler interface, i.e. BCELClosureCompilerImpl and ASMClosureCompilerImpl. It contains common implementation for above classes.

Author:
Sanjeeb.Sahoo@Sun.COM

Field Summary
protected  HashSet<String> excludedClasses
           
protected  HashSet<String> excludedPackages
           
protected  HashSet<String> excludedPatterns
           
protected  ClassFileLoader loader
           
protected static Logger logger
           
protected  HashSet<String> visitedClasses
           
 
Constructor Summary
protected ClosureCompilerImplBase(ClassFileLoader loader)
           
 
Method Summary
 void addExcludedClass(String className)
           
 void addExcludedPackage(String pkgName)
           
 void addExcludedPattern(String pattern)
           
 boolean buildClosure(JarFile jar)
           
 Collection<String> getNativeMethods()
           
protected static String getPackageName(String className)
           
protected  boolean needToBuildClosure(String className)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.enterprise.tools.verifier.apiscan.classfile.ClosureCompiler
buildClosure, getClosure, getFailed, reset
 

Field Detail

loader

protected ClassFileLoader loader

excludedClasses

protected HashSet<String> excludedClasses

excludedPackages

protected HashSet<String> excludedPackages

excludedPatterns

protected HashSet<String> excludedPatterns

visitedClasses

protected HashSet<String> visitedClasses

logger

protected static final Logger logger
Constructor Detail

ClosureCompilerImplBase

protected ClosureCompilerImplBase(ClassFileLoader loader)
Parameters:
loader - the ClassFileLoader that is used to load the referenced classes.
Method Detail

addExcludedClass

public void addExcludedClass(String className)
Parameters:
className - the class name to be excluded from closure computation. It is in the external class name format (i.e. java.util.Map$Entry instead of java.util.Map.Entry). When the closure compiler sees a class matches this name, it does not try to compute its closure any more. It merely adds this name to the closure. So the final closure will contain this class name, but not its dependencies.

addExcludedPackage

public void addExcludedPackage(String pkgName)
Parameters:
pkgName - the package name of classes to be excluded from closure computation. It is in the external format (i.e. java.lang (See no trailing '.'). When the closure compiler sees a class whose package name matches this name, it does not try to compute the closure of that class any more. It merely adds that class name to the closure. So the final closure will contain that class name, but not its dependencies.

addExcludedPattern

public void addExcludedPattern(String pattern)
Parameters:
pattern - the pattern for the names of classes to be excluded from closure computation. It is in the external format (i.e. org.apache.). When the closure compiler sees a class whose name begins with this pattern, it does not try to compute the closure of that class any more. It merely adds that class name to the closure. So the final closure will contain that class name, but not its dependencies. Among all the excluded list, it is given the lowest priority in search order.

buildClosure

public boolean buildClosure(JarFile jar)
                     throws IOException
Parameters:
jar - whose classes it will try to build closure of. This is a convenience method which iterates over all the entries in a jar file and computes their closure.
Throws:
IOException

getNativeMethods

public Collection<String> getNativeMethods()

needToBuildClosure

protected boolean needToBuildClosure(String className)
Parameters:
className - name of class in external format.
Returns:

getPackageName

protected static String getPackageName(String className)
Parameters:
className - name of class in external format.
Returns:
package name in dotted format, e.g. java.lang for java.lang.void


Copyright © 2013 Oracle Corporation. All Rights Reserved.