Class Clazz


  • public class Clazz
    extends java.lang.Object
    • Constructor Detail

      • Clazz

        public Clazz​(Analyzer analyzer,
                     java.lang.String path,
                     Resource resource)
    • Method Detail

      • parseClassFile

        public java.util.Set<Descriptors.TypeRef> parseClassFile()
                                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • parseClassFile

        public java.util.Set<Descriptors.TypeRef> parseClassFile​(java.io.InputStream in)
                                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • parseClassFileData

        private java.util.Set<Descriptors.TypeRef> parseClassFileData​(java.io.DataInput in,
                                                                      ClassDataCollector cd)
                                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • parseClassFileData

        private java.util.Set<Descriptors.TypeRef> parseClassFileData​(java.io.DataInput in)
                                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • visitClassFile

        private void visitClassFile​(ClassDataCollector cd)
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • findMethodReference

        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.
        Parameters:
        clazz -
        methodname -
        descriptor -
        Returns:
        index in constant pool
      • processAttributes

        private void processAttributes​(Attribute[] attributes,
                                       Annotation.ElementType elementType,
                                       int access_flags)
        Called for the attributes in the class, field, method or Code attribute.
      • visitAttributes

        private void visitAttributes​(ClassDataCollector cd,
                                     Clazz.ElementDef elementDef)
                              throws java.lang.Exception
        Called for the attributes in the class, field, or method.
        Throws:
        java.lang.Exception
      • processExceptions

        private void processExceptions​(ExceptionsAttribute attribute,
                                       int access_flags)
      • visitReferenceMethod

        private void visitReferenceMethod​(ClassDataCollector cd,
                                          int method_ref_index)
        Called when crawling the byte code and a method reference is found
      • processAnnotation

        private void processAnnotation​(AnnotationInfo annotationInfo,
                                       Annotation.ElementType elementType,
                                       java.lang.annotation.RetentionPolicy policy,
                                       int access_flags)
      • annotationValues

        private java.util.Map<java.lang.String,​java.lang.Object> annotationValues​(ElementValueInfo[] values,
                                                                                        Annotation.ElementType elementType,
                                                                                        java.lang.annotation.RetentionPolicy policy,
                                                                                        int access_flags)
      • processElementValue

        private void processElementValue​(java.lang.Object value,
                                         Annotation.ElementType elementType,
                                         java.lang.annotation.RetentionPolicy policy,
                                         int access_flags)
      • newElementValue

        private java.lang.Object newElementValue​(java.lang.Object value,
                                                 Annotation.ElementType elementType,
                                                 java.lang.annotation.RetentionPolicy policy,
                                                 int access_flags)
      • referTo

        private void referTo​(Descriptors.TypeRef typeRef,
                             int modifiers)
        Add a new package reference.
        Parameters:
        packageRef - A '.' delimited package name
      • referTo

        private void referTo​(java.lang.String descriptor,
                             int modifiers)
      • parseDescriptor

        @Deprecated
        public void parseDescriptor​(java.lang.String descriptor,
                                    int modifiers)
        Deprecated.
        This method parses method or field descriptors and calls referTo(TypeRef, int) for any types found therein.
        Parameters:
        descriptor - The to be parsed descriptor
        modifiers -
        See Also:
        "https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.3"
      • getAbsolutePath

        public java.lang.String getAbsolutePath()
      • reset

        @Deprecated
        public void reset()
        Deprecated.
      • hierarchyStream

        private java.util.stream.Stream<Clazz> hierarchyStream​(Analyzer analyzer)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isPublic

        public boolean isPublic()
      • isProtected

        public boolean isProtected()
      • isEnum

        public boolean isEnum()
      • isSynthetic

        public boolean isSynthetic()
      • isSynthetic

        static boolean isSynthetic​(int access)
      • isModule

        public boolean isModule()
      • isModule

        static boolean isModule​(int access)
      • objectDescriptorToFQN

        public static java.lang.String objectDescriptorToFQN​(java.lang.String string)
      • unCamel

        public static java.lang.String unCamel​(java.lang.String id)
      • isInterface

        public boolean isInterface()
      • isAbstract

        public boolean isAbstract()
      • hasPublicNoArgsConstructor

        public boolean hasPublicNoArgsConstructor()
      • getAccess

        public int getAccess()
      • setInnerAccess

        @Deprecated
        public void setInnerAccess​(int access)
        Deprecated.
      • annotations

        public java.util.stream.Stream<Annotation> annotations​(java.lang.String binaryNameFilter)
      • typeAnnotations

        public java.util.stream.Stream<TypeAnnotation> typeAnnotations​(java.lang.String binaryNameFilter)
      • isInnerClass

        public boolean isInnerClass()
      • getMethodDef

        @Deprecated
        public Clazz.MethodDef getMethodDef​(int access,
                                            java.lang.String name,
                                            java.lang.String descriptor)
        Deprecated.
      • getFQN

        public java.lang.String getFQN()
      • isFinal

        public boolean isFinal()
      • setDeprecated

        @Deprecated
        public void setDeprecated​(boolean b)
        Deprecated.
      • isDeprecated

        public boolean isDeprecated()
      • isAnnotation

        public boolean isAnnotation()
      • isAnnotation

        static boolean isAnnotation​(int access)
      • classConstRef

        private void classConstRef​(int index)
      • classConstRef

        private void classConstRef​(java.lang.String name)
      • getClassSignature

        public java.lang.String getClassSignature()
      • getSourceFile

        public java.lang.String getSourceFile()
      • getDefaults

        public java.util.Map<java.lang.String,​java.lang.Object> getDefaults()
                                                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getResource

        public Resource getResource()