JarAnalyzer Source Code Files

Apache Ant Source Code Files are inside the JarAnalyzer source package like JarAnalyzer-src-1.2.zip. Unzip the source package and go to the "src" sub-directory, you will see source code files.

Here is the list of Java source code files of the JarAnalyzer 1.2 in \Users\fyicenter\JarAnalyzer\src:

✍: FYIcenter.com

com/kirkk/analyzer/framework/bcelbundle/JarPackageImpl.java

package com.kirkk.analyzer.framework.bcelbundle;

import com.kirkk.analyzer.framework.JarPackage;
import com.kirkk.analyzer.framework.JarClass;
import java.util.*;

public class JarPackageImpl implements JarPackage {

    private String packageName;
    private List classes;

    public JarPackageImpl(String packageName) {
        if(packageName== null) {
            throw new NullPointerException("Package name cannot be null");
        } else {
            this.packageName = packageName;
        }
    }

    public void addClass(JarClass jarClass) {
        if(classes == null) {
            classes = new ArrayList();
		}
        classes.add(jarClass);
    }

    public List getClasses() {
		return this.classes;
		/*Iterator classIterator = this.publicClasses.iterator();
		List publicList = new ArrayList();
		while (classIterator.hasNext()) {
			PublicClass cls = (PublicClass) classIterator.next();
			if (cls.isPublic()) {
				publicList.add(cls);
			}
		}
        return publicList;*/
    }

    public int getClassCount() {
		return this.classes.size();
	}

    public String getLongName() {
        return this.packageName;
    }

    public boolean equals(Object obj) {
        if(obj instanceof JarPackage) {
            JarPackage javapackage = (JarPackage)obj;
            if(getLongName().equals(javapackage.getLongName())) {
                return true;
			}
        }
        return false;
    }

    public int hashCode() {
        return packageName.hashCode();
    }

    public List getImportedPackageNames() {
		List importedPackages = new ArrayList();
		Iterator classes = this.classes.iterator();
		while (classes.hasNext()) {
			JarClass cls = (JarClass) classes.next();
			Iterator packages = cls.getImportedPackageNames().iterator();
			while (packages.hasNext()) {
				String packageName = (String) packages.next();
				if (!importedPackages.contains(packageName)) {
					importedPackages.add(packageName);
				}
			}
		}
		return importedPackages;
	}
}

com/kirkk/analyzer/framework/bcelbundle/JarPackageImpl.java

 

 

⇒ jarscan - JAR File Scanner

⇐ Download JarAnalyzer Source Package

⇑ JarAnalyzer by Kirk Knoernschild

⇑⇑ Java/JAR Tools

2021-07-01, 2502👍, 0💬