public abstract class ClosureCompilerImplBase extends Object implements ClosureCompiler
BCELClosureCompilerImpl
and
ASMClosureCompilerImpl
.
It contains common implementation for above classes.Modifier and Type | Field and Description |
---|---|
protected HashSet<String> |
excludedClasses |
protected HashSet<String> |
excludedPackages |
protected HashSet<String> |
excludedPatterns |
protected ClassFileLoader |
loader |
protected static Logger |
logger |
protected HashSet<String> |
visitedClasses |
Modifier | Constructor and Description |
---|---|
protected |
ClosureCompilerImplBase(ClassFileLoader loader) |
Modifier and Type | Method and Description |
---|---|
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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
buildClosure, getClosure, getFailed, reset
protected ClassFileLoader loader
protected static final Logger logger
protected ClosureCompilerImplBase(ClassFileLoader loader)
loader
- the ClassFileLoader that is used to load the referenced
classes.public void addExcludedClass(String className)
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.public void addExcludedPackage(String pkgName)
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.public void addExcludedPattern(String pattern)
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.public boolean buildClosure(JarFile jar) throws IOException
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.IOException
public Collection<String> getNativeMethods()
protected boolean needToBuildClosure(String className)
className
- name of class in external format.Copyright © 2009–2023 Oracle Corporation. All rights reserved.