public class Clazz
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
Clazz.Assoc
Deprecated.
|
class |
Clazz.ClassConstant
Deprecated.
|
(package private) class |
Clazz.ClassDef |
(package private) class |
Clazz.CodeDef |
class |
Clazz.Def |
(package private) class |
Clazz.ElementDef |
class |
Clazz.FieldDef |
static class |
Clazz.JAVA |
class |
Clazz.MethodDef |
static class |
Clazz.MethodParameter |
static class |
Clazz.QUERY |
class |
Clazz.TypeDef |
Modifier and Type | Field and Description |
---|---|
(package private) static int |
ACC_ANNOTATION |
(package private) static int |
ACC_BRIDGE |
(package private) static int |
ACC_ENUM |
(package private) static int |
ACC_MODULE |
(package private) static int |
ACC_SYNTHETIC |
(package private) Analyzer |
analyzer |
private java.util.Set<Descriptors.TypeRef> |
annotations |
private java.util.Set<Descriptors.PackageRef> |
api |
private int |
class$ |
(package private) Clazz.ClassDef |
classDef |
private ClassFile |
classFile |
private ConstantPool |
constantPool |
private int |
forName |
static java.util.EnumSet<Clazz.QUERY> |
HAS_ARGUMENT |
private boolean |
hasClassAnnotations |
private boolean |
hasDefaultConstructor |
private boolean |
hasRuntimeAnnotations |
private java.util.Set<Descriptors.PackageRef> |
imports |
private Descriptors.TypeRef[] |
interfaces |
private static org.slf4j.Logger |
logger |
static java.util.Comparator<Clazz> |
NAME_COMPARATOR |
(package private) java.lang.String |
path |
private java.util.Map<Descriptors.TypeRef,java.lang.Integer> |
referred |
(package private) Resource |
resource |
(package private) Descriptors.TypeRef |
superClass |
static int |
TYPEUSE_INDEX_NONE |
static int |
TYPEUSE_TARGET_INDEX_EXTENDS |
private java.util.Set<Descriptors.TypeRef> |
xref |
Constructor and Description |
---|
Clazz(Analyzer analyzer,
java.lang.String path,
Resource resource) |
Modifier and Type | Method and Description |
---|---|
(package private) java.lang.Object |
annotationDefault(AnnotationDefaultAttribute attribute,
int access_flags) |
java.util.Set<Descriptors.TypeRef> |
annotations() |
java.util.stream.Stream<Annotation> |
annotations(java.lang.String binaryNameFilter) |
private java.util.Map<java.lang.String,java.lang.Object> |
annotationValues(ElementValueInfo[] values,
Annotation.ElementType elementType,
java.lang.annotation.RetentionPolicy policy,
int access_flags) |
private void |
classConstRef(int index) |
private void |
classConstRef(java.lang.String name) |
(package private) static Annotation.ElementType |
elementType(ClassFile classFile) |
(package private) static Annotation.ElementType |
elementType(FieldInfo fieldInfo) |
(package private) static Annotation.ElementType |
elementType(MethodInfo methodInfo) |
java.util.stream.Stream<Clazz.FieldDef> |
fields() |
private int |
findMethodReference(java.lang.String clazz,
java.lang.String methodname,
java.lang.String descriptor)
Find a method reference in the pool that points to the given class,
methodname and descriptor.
|
java.lang.String |
getAbsolutePath() |
int |
getAccess() |
java.util.Set<Descriptors.PackageRef> |
getAPIUses() |
Descriptors.TypeRef |
getClassName() |
java.lang.String |
getClassSignature() |
java.util.Map<java.lang.String,java.lang.Object> |
getDefaults() |
Clazz.TypeDef |
getExtends(Descriptors.TypeRef type) |
Clazz.JAVA |
getFormat() |
java.lang.String |
getFQN() |
Clazz.TypeDef |
getImplements(Descriptors.TypeRef type) |
Descriptors.TypeRef[] |
getInterfaces() |
Clazz.MethodDef |
getMethodDef(int access,
java.lang.String name,
java.lang.String descriptor)
Deprecated.
|
java.util.Set<Descriptors.PackageRef> |
getReferred() |
Resource |
getResource() |
java.lang.String |
getSourceFile() |
Descriptors.TypeRef |
getSuper() |
boolean |
hasPublicNoArgsConstructor() |
private java.util.stream.Stream<Clazz> |
hierarchyStream(Analyzer analyzer) |
java.util.List<Descriptors.TypeRef> |
interfaces() |
boolean |
is(Clazz.QUERY query,
Instruction instr,
Analyzer analyzer) |
boolean |
isAbstract() |
boolean |
isAnnotation() |
(package private) static boolean |
isAnnotation(int access) |
boolean |
isDeprecated() |
boolean |
isEnum() |
boolean |
isFinal() |
boolean |
isInnerClass() |
boolean |
isInterface() |
boolean |
isModule() |
(package private) static boolean |
isModule(int access) |
boolean |
isProtected() |
boolean |
isPublic() |
boolean |
isSynthetic() |
java.util.stream.Stream<Clazz.MethodDef> |
methods() |
(package private) Annotation |
newAnnotation(AnnotationInfo annotationInfo,
Annotation.ElementType elementType,
java.lang.annotation.RetentionPolicy policy,
int access_flags) |
private java.lang.Object |
newElementValue(java.lang.Object value,
Annotation.ElementType elementType,
java.lang.annotation.RetentionPolicy policy,
int access_flags) |
(package private) ParameterAnnotation |
newParameterAnnotation(int parameter,
AnnotationInfo annotationInfo,
Annotation.ElementType elementType,
java.lang.annotation.RetentionPolicy policy,
int access_flags) |
(package private) TypeAnnotation |
newTypeAnnotation(TypeAnnotationInfo annotationInfo,
Annotation.ElementType elementType,
java.lang.annotation.RetentionPolicy policy,
int access_flags) |
static java.lang.String |
objectDescriptorToFQN(java.lang.String string) |
java.util.Set<Descriptors.TypeRef> |
parseClassFile() |
java.util.Set<Descriptors.TypeRef> |
parseClassFile(java.io.InputStream in) |
java.util.Set<Descriptors.TypeRef> |
parseClassFile(java.io.InputStream in,
ClassDataCollector cd) |
private java.util.Set<Descriptors.TypeRef> |
parseClassFileData(java.io.DataInput in) |
private java.util.Set<Descriptors.TypeRef> |
parseClassFileData(java.io.DataInput in,
ClassDataCollector cd) |
java.util.Set<Descriptors.TypeRef> |
parseClassFileWithCollector(ClassDataCollector cd) |
void |
parseDescriptor(java.lang.String descriptor,
int modifiers)
Deprecated.
|
private void |
processAnnotation(AnnotationInfo annotationInfo,
Annotation.ElementType elementType,
java.lang.annotation.RetentionPolicy policy,
int access_flags) |
private void |
processAnnotationDefault(AnnotationDefaultAttribute attribute,
Annotation.ElementType elementType,
int access_flags) |
private void |
processAnnotations(AnnotationsAttribute attribute,
Annotation.ElementType elementType,
java.lang.annotation.RetentionPolicy policy,
int access_flags) |
private void |
processAttributes(Attribute[] attributes,
Annotation.ElementType elementType,
int access_flags)
Called for the attributes in the class, field, method or Code attribute.
|
private void |
processBootstrapMethods(BootstrapMethodsAttribute attribute) |
private void |
processCode(CodeAttribute attribute,
Annotation.ElementType elementType) |
private void |
processElementValue(java.lang.Object value,
Annotation.ElementType elementType,
java.lang.annotation.RetentionPolicy policy,
int access_flags) |
private void |
processEnclosingMethod(EnclosingMethodAttribute attribute) |
private void |
processExceptions(ExceptionsAttribute attribute,
int access_flags) |
private void |
processParameterAnnotations(ParameterAnnotationsAttribute attribute,
Annotation.ElementType elementType,
java.lang.annotation.RetentionPolicy policy,
int access_flags) |
private void |
processSignature(SignatureAttribute attribute,
Annotation.ElementType elementType,
int access_flags) |
private void |
processStackMapTable(StackMapTableAttribute attribute) |
private void |
processTypeAnnotations(TypeAnnotationsAttribute attribute,
Annotation.ElementType elementType,
java.lang.annotation.RetentionPolicy policy,
int access_flags) |
private void |
referTo(Descriptors.TypeRef typeRef,
int modifiers)
Add a new package reference.
|
private void |
referTo(java.lang.String descriptor,
int modifiers) |
void |
reset()
Deprecated.
|
void |
setDeprecated(boolean b)
Deprecated.
|
void |
setInnerAccess(int access)
Deprecated.
|
java.lang.String |
toString() |
java.util.stream.Stream<TypeAnnotation> |
typeAnnotations(java.lang.String binaryNameFilter) |
private java.util.stream.Stream<Descriptors.TypeRef> |
typeStream(Analyzer analyzer,
java.util.function.Function<? super Clazz,java.util.Collection<? extends Descriptors.TypeRef>> func,
java.util.Set<Descriptors.TypeRef> visited) |
static java.lang.String |
unCamel(java.lang.String id) |
private void |
verification_type_info(StackMapTableAttribute.VerificationTypeInfo verificationTypeInfo) |
private void |
visitAnnotationDefault(ClassDataCollector cd,
AnnotationDefaultAttribute attribute,
Clazz.ElementDef elementDef) |
private void |
visitAnnotations(ClassDataCollector cd,
AnnotationsAttribute attribute,
Annotation.ElementType elementType,
java.lang.annotation.RetentionPolicy policy,
int access_flags) |
private void |
visitAttributes(ClassDataCollector cd,
Clazz.ElementDef elementDef)
Called for the attributes in the class, field, or method.
|
private void |
visitClassFile(ClassDataCollector cd) |
private void |
visitCode(ClassDataCollector cd,
CodeAttribute attribute,
Annotation.ElementType elementType) |
private void |
visitConstantValue(ClassDataCollector cd,
ConstantValueAttribute attribute) |
private void |
visitEnclosingMethod(ClassDataCollector cd,
EnclosingMethodAttribute attribute) |
private void |
visitInnerClasses(ClassDataCollector cd,
InnerClassesAttribute attribute) |
private void |
visitMethodParameters(ClassDataCollector cd,
MethodParametersAttribute attribute,
Clazz.ElementDef elementDef) |
private void |
visitParameterAnnotations(ClassDataCollector cd,
ParameterAnnotationsAttribute attribute,
Annotation.ElementType elementType,
java.lang.annotation.RetentionPolicy policy,
int access_flags) |
private void |
visitReferenceMethod(ClassDataCollector cd,
int method_ref_index)
Called when crawling the byte code and a method reference is found
|
private void |
visitSignature(ClassDataCollector cd,
SignatureAttribute attribute) |
private void |
visitTypeAnnotations(ClassDataCollector cd,
TypeAnnotationsAttribute attribute,
Annotation.ElementType elementType,
java.lang.annotation.RetentionPolicy policy,
int access_flags) |
private static final org.slf4j.Logger logger
public static final java.util.EnumSet<Clazz.QUERY> HAS_ARGUMENT
static final int ACC_SYNTHETIC
static final int ACC_BRIDGE
static final int ACC_ANNOTATION
static final int ACC_ENUM
static final int ACC_MODULE
public static final java.util.Comparator<Clazz> NAME_COMPARATOR
private boolean hasRuntimeAnnotations
private boolean hasClassAnnotations
private boolean hasDefaultConstructor
private java.util.Set<Descriptors.PackageRef> imports
private java.util.Set<Descriptors.TypeRef> xref
private java.util.Set<Descriptors.TypeRef> annotations
private int forName
private int class$
private java.util.Set<Descriptors.PackageRef> api
private ClassFile classFile
private ConstantPool constantPool
Descriptors.TypeRef superClass
private Descriptors.TypeRef[] interfaces
Clazz.ClassDef classDef
private java.util.Map<Descriptors.TypeRef,java.lang.Integer> referred
final Analyzer analyzer
final java.lang.String path
final Resource resource
public static final int TYPEUSE_INDEX_NONE
public static final int TYPEUSE_TARGET_INDEX_EXTENDS
public java.util.Set<Descriptors.TypeRef> parseClassFile() throws java.lang.Exception
java.lang.Exception
public java.util.Set<Descriptors.TypeRef> parseClassFile(java.io.InputStream in) throws java.lang.Exception
java.lang.Exception
public java.util.Set<Descriptors.TypeRef> parseClassFileWithCollector(ClassDataCollector cd) throws java.lang.Exception
java.lang.Exception
public java.util.Set<Descriptors.TypeRef> parseClassFile(java.io.InputStream in, ClassDataCollector cd) throws java.lang.Exception
java.lang.Exception
private java.util.Set<Descriptors.TypeRef> parseClassFileData(java.io.DataInput in, ClassDataCollector cd) throws java.lang.Exception
java.lang.Exception
private java.util.Set<Descriptors.TypeRef> parseClassFileData(java.io.DataInput in) throws java.lang.Exception
java.lang.Exception
private void visitClassFile(ClassDataCollector cd) throws java.lang.Exception
java.lang.Exception
public java.util.stream.Stream<Clazz.FieldDef> fields()
public java.util.stream.Stream<Clazz.MethodDef> methods()
private int findMethodReference(java.lang.String clazz, java.lang.String methodname, java.lang.String descriptor)
clazz
- methodname
- descriptor
- private void processAttributes(Attribute[] attributes, Annotation.ElementType elementType, int access_flags)
private void visitAttributes(ClassDataCollector cd, Clazz.ElementDef elementDef) throws java.lang.Exception
java.lang.Exception
private void processEnclosingMethod(EnclosingMethodAttribute attribute)
private void visitEnclosingMethod(ClassDataCollector cd, EnclosingMethodAttribute attribute)
private void visitInnerClasses(ClassDataCollector cd, InnerClassesAttribute attribute) throws java.lang.Exception
java.lang.Exception
private void processSignature(SignatureAttribute attribute, Annotation.ElementType elementType, int access_flags)
private void visitSignature(ClassDataCollector cd, SignatureAttribute attribute)
private void processAnnotationDefault(AnnotationDefaultAttribute attribute, Annotation.ElementType elementType, int access_flags)
private void visitAnnotationDefault(ClassDataCollector cd, AnnotationDefaultAttribute attribute, Clazz.ElementDef elementDef)
static Annotation.ElementType elementType(FieldInfo fieldInfo)
static Annotation.ElementType elementType(MethodInfo methodInfo)
static Annotation.ElementType elementType(ClassFile classFile)
java.lang.Object annotationDefault(AnnotationDefaultAttribute attribute, int access_flags)
private void visitConstantValue(ClassDataCollector cd, ConstantValueAttribute attribute)
private void processExceptions(ExceptionsAttribute attribute, int access_flags)
private void visitMethodParameters(ClassDataCollector cd, MethodParametersAttribute attribute, Clazz.ElementDef elementDef)
private void processCode(CodeAttribute attribute, Annotation.ElementType elementType)
private void visitCode(ClassDataCollector cd, CodeAttribute attribute, Annotation.ElementType elementType) throws java.lang.Exception
java.lang.Exception
private void visitReferenceMethod(ClassDataCollector cd, int method_ref_index)
private void processParameterAnnotations(ParameterAnnotationsAttribute attribute, Annotation.ElementType elementType, java.lang.annotation.RetentionPolicy policy, int access_flags)
private void visitParameterAnnotations(ClassDataCollector cd, ParameterAnnotationsAttribute attribute, Annotation.ElementType elementType, java.lang.annotation.RetentionPolicy policy, int access_flags) throws java.lang.Exception
java.lang.Exception
private void processTypeAnnotations(TypeAnnotationsAttribute attribute, Annotation.ElementType elementType, java.lang.annotation.RetentionPolicy policy, int access_flags)
private void visitTypeAnnotations(ClassDataCollector cd, TypeAnnotationsAttribute attribute, Annotation.ElementType elementType, java.lang.annotation.RetentionPolicy policy, int access_flags) throws java.lang.Exception
java.lang.Exception
private void processAnnotations(AnnotationsAttribute attribute, Annotation.ElementType elementType, java.lang.annotation.RetentionPolicy policy, int access_flags)
private void visitAnnotations(ClassDataCollector cd, AnnotationsAttribute attribute, Annotation.ElementType elementType, java.lang.annotation.RetentionPolicy policy, int access_flags) throws java.lang.Exception
java.lang.Exception
private void processAnnotation(AnnotationInfo annotationInfo, Annotation.ElementType elementType, java.lang.annotation.RetentionPolicy policy, int access_flags)
Annotation newAnnotation(AnnotationInfo annotationInfo, Annotation.ElementType elementType, java.lang.annotation.RetentionPolicy policy, int access_flags)
ParameterAnnotation newParameterAnnotation(int parameter, AnnotationInfo annotationInfo, Annotation.ElementType elementType, java.lang.annotation.RetentionPolicy policy, int access_flags)
TypeAnnotation newTypeAnnotation(TypeAnnotationInfo annotationInfo, Annotation.ElementType elementType, java.lang.annotation.RetentionPolicy policy, int access_flags)
private java.util.Map<java.lang.String,java.lang.Object> annotationValues(ElementValueInfo[] values, Annotation.ElementType elementType, java.lang.annotation.RetentionPolicy policy, int access_flags)
private void processElementValue(java.lang.Object value, Annotation.ElementType elementType, java.lang.annotation.RetentionPolicy policy, int access_flags)
private java.lang.Object newElementValue(java.lang.Object value, Annotation.ElementType elementType, java.lang.annotation.RetentionPolicy policy, int access_flags)
private void processBootstrapMethods(BootstrapMethodsAttribute attribute)
private void processStackMapTable(StackMapTableAttribute attribute)
private void verification_type_info(StackMapTableAttribute.VerificationTypeInfo verificationTypeInfo)
private void referTo(Descriptors.TypeRef typeRef, int modifiers)
packageRef
- A '.' delimited package nameprivate void referTo(java.lang.String descriptor, int modifiers)
@Deprecated public void parseDescriptor(java.lang.String descriptor, int modifiers)
#referTo(TypeRef, int)
for any types found therein.descriptor
- The to be parsed descriptormodifiers
- public java.util.Set<Descriptors.PackageRef> getReferred()
public java.lang.String getAbsolutePath()
@Deprecated public void reset()
private java.util.stream.Stream<Descriptors.TypeRef> typeStream(Analyzer analyzer, java.util.function.Function<? super Clazz,java.util.Collection<? extends Descriptors.TypeRef>> func, java.util.Set<Descriptors.TypeRef> visited)
public boolean is(Clazz.QUERY query, Instruction instr, Analyzer analyzer) throws java.lang.Exception
java.lang.Exception
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isPublic()
public boolean isProtected()
public boolean isEnum()
public boolean isSynthetic()
public boolean isModule()
static boolean isModule(int access)
public Clazz.JAVA getFormat()
public static java.lang.String objectDescriptorToFQN(java.lang.String string)
public static java.lang.String unCamel(java.lang.String id)
public boolean isInterface()
public boolean isAbstract()
public boolean hasPublicNoArgsConstructor()
public int getAccess()
@Deprecated public void setInnerAccess(int access)
public java.util.stream.Stream<Annotation> annotations(java.lang.String binaryNameFilter)
public java.util.stream.Stream<TypeAnnotation> typeAnnotations(java.lang.String binaryNameFilter)
public Descriptors.TypeRef getClassName()
public boolean isInnerClass()
@Deprecated public Clazz.MethodDef getMethodDef(int access, java.lang.String name, java.lang.String descriptor)
public Descriptors.TypeRef getSuper()
public java.lang.String getFQN()
public Descriptors.TypeRef[] getInterfaces()
public java.util.List<Descriptors.TypeRef> interfaces()
public java.util.Set<Descriptors.TypeRef> annotations()
public boolean isFinal()
@Deprecated public void setDeprecated(boolean b)
public boolean isDeprecated()
public boolean isAnnotation()
static boolean isAnnotation(int access)
public java.util.Set<Descriptors.PackageRef> getAPIUses()
public Clazz.TypeDef getExtends(Descriptors.TypeRef type)
public Clazz.TypeDef getImplements(Descriptors.TypeRef type)
private void classConstRef(int index)
private void classConstRef(java.lang.String name)
public java.lang.String getClassSignature()
public java.lang.String getSourceFile()
public java.util.Map<java.lang.String,java.lang.Object> getDefaults() throws java.lang.Exception
java.lang.Exception
public Resource getResource()