|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.bcel.classfile.EmptyVisitor
org.apache.maven.shared.jar.classes.ImportVisitor
public class ImportVisitor
Implementation of a BCEL class visitor that analyzes a class and collects imports.
| Field Summary | |
|---|---|
private java.util.List |
imports
The list of imports discovered. |
private org.apache.bcel.classfile.JavaClass |
javaClass
The Java class that is being analyzed. |
private static java.util.regex.Pattern |
QUALIFIED_IMPORT_PATTERN
Pattern to detect if the import is qualified and allows retrieval of the actual import name from the string via the group 1. |
private static java.util.regex.Pattern |
VALID_UTF8_PATTERN
Pattern that checks whether a string is valid UTF-8. |
| Constructor Summary | |
|---|---|
ImportVisitor(org.apache.bcel.classfile.JavaClass javaClass)
Create an Import visitor. |
|
| Method Summary | |
|---|---|
java.util.List |
getImports()
Get the list of discovered imports. |
void |
visitConstantClass(org.apache.bcel.classfile.ConstantClass constantClass)
Find any formally declared import in the Constant Pool. |
void |
visitConstantUtf8(org.apache.bcel.classfile.ConstantUtf8 constantUtf8)
Find any package class Strings in the UTF8 String Pool. |
| Methods inherited from class org.apache.bcel.classfile.EmptyVisitor |
|---|
visitCode, visitCodeException, visitConstantDouble, visitConstantFieldref, visitConstantFloat, visitConstantInteger, visitConstantInterfaceMethodref, visitConstantLong, visitConstantMethodref, visitConstantNameAndType, visitConstantPool, visitConstantString, visitConstantValue, visitDeprecated, visitExceptionTable, visitField, visitInnerClass, visitInnerClasses, visitJavaClass, visitLineNumber, visitLineNumberTable, visitLocalVariable, visitLocalVariableTable, visitMethod, visitSignature, visitSourceFile, visitStackMap, visitStackMapEntry, visitSynthetic, visitUnknown |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.util.List imports
private org.apache.bcel.classfile.JavaClass javaClass
private static final java.util.regex.Pattern QUALIFIED_IMPORT_PATTERN
private static final java.util.regex.Pattern VALID_UTF8_PATTERN
| Constructor Detail |
|---|
public ImportVisitor(org.apache.bcel.classfile.JavaClass javaClass)
javaClass - the javaclass to work from| Method Detail |
|---|
public java.util.List getImports()
public void visitConstantClass(org.apache.bcel.classfile.ConstantClass constantClass)
visitConstantClass in interface org.apache.bcel.classfile.VisitorvisitConstantClass in class org.apache.bcel.classfile.EmptyVisitorEmptyVisitor.visitConstantClass(org.apache.bcel.classfile.ConstantClass)public void visitConstantUtf8(org.apache.bcel.classfile.ConstantUtf8 constantUtf8)
visitConstantUtf8 in interface org.apache.bcel.classfile.VisitorvisitConstantUtf8 in class org.apache.bcel.classfile.EmptyVisitorEmptyVisitor.visitConstantUtf8(org.apache.bcel.classfile.ConstantUtf8)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||