Constructors Summary |
---|
public BCELClassFile(InputStream is, String file_name) // NOI18N
logger.entering(myClassName, "<init>(InputStream, String)", file_name); // NOI18N
jc = new ClassParser(is, file_name).parse();
|
public BCELClassFile(String file_path)
logger.entering(myClassName, "<init>(String)", file_path); // NOI18N
jc = new ClassParser(file_path).parse();
|
Methods Summary |
---|
public synchronized java.util.Collection | getAllReferencedClassNames()
if (classNames == null) {
getAllReferencedClassNamesInInternalForm();
}
HashSet<String> extClassNames = new HashSet<String>(classNames.size());
for (Iterator i = classNames.iterator(); i.hasNext();) {
extClassNames.add(Util.convertToExternalClassName((String) i.next()));
}
return extClassNames;
|
public synchronized java.util.Collection | getAllReferencedClassNamesInInternalForm()
if (classNames == null) {
classNames = new HashSet<String>();//lazy instantiation
logger.logp(Level.FINER, myClassName, "getAllReferencedClassNames", // NOI18N
"Starting to visit"); // NOI18N
jc.accept(new DescendingVisitor(jc, new Visitor(this)));
logger.logp(Level.FINER, myClassName, "getAllReferencedClassNames", // NOI18N
"Finished visting"); // NOI18N
classNames = Collections.unmodifiableSet(classNames);
}
return classNames;
|
public java.lang.String | getInternalName()
return Util.convertToInternalClassName(getName());
|
public java.lang.String | getInternalNameOfSuperClass()
return Util.convertToInternalClassName(getNameOfSuperClass());
|
public java.lang.String[] | getInternalNamesOfInterfaces()
String[] result = getNamesOfInterfaces();
for(int i = 0; i< result.length; ++i) {
result[i] = Util.convertToInternalClassName(result[i]);
}
return result;
|
public com.sun.enterprise.tools.verifier.apiscan.classfile.Method | getMethod(MethodRef methodRef)
throw new UnsupportedOperationException();
|
public java.util.Collection | getMethods()
return Collections.unmodifiableSet(methods);
|
public java.lang.String | getName()
return jc.getClassName();
|
public java.lang.String | getNameOfSuperClass()
return jc.getSuperclassName();
|
public java.lang.String[] | getNamesOfInterfaces()
return jc.getInterfaceNames();
|
public java.lang.String | getPackageName()
//not necessary as we always use external name for package. .replace('.','/');
return jc.getPackageName();
|
public boolean | isInterface()
return !jc.isClass();
|
private static java.util.List | signatureToClassNames(java.lang.String signature)
logger.entering(myClassName, "signatureToClassNames", signature); // NOI18N
List<String> result = new ArrayList<String>();
int i = 0;
while ((i = signature.indexOf('L", i)) != -1) {
int j = signature.indexOf(';", i);
if (j > i) {
// get name, minus leading 'L' and trailing ';'
String className = signature.substring(i + 1, j);
if (!Util.isPrimitive(className)) result.add(className);
i = j + 1;
} else
break;
}
if (logger.isLoggable(Level.FINE)) {
StringBuffer sb = new StringBuffer("Class Names are {"); // NOI18N
int size = result.size();
for (int k = 0; k < size; k++) {
sb.append((String) result.get(k));
if (k != size - 1) sb.append(", "); // NOI18N
}
sb.append("}"); // NOI18N
logger.finer(sb.toString());
}
return result;
|
public java.lang.String | toString()
return
"External Name: " + getName() + "\n" + // NOI18N
"Internal Name: " + getInternalName() + "\n" + // NOI18N
jc.toString()
+ "\n------------CONSTANT POOL BEGIN--------------\n" // NOI18N
+ jc.getConstantPool()
+ "\n------------CONSTANT POOL END--------------"; // NOI18N
|