Class Clazz


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

      • HAS_ARGUMENT

        public static final java.util.EnumSet<Clazz.QUERY> HAS_ARGUMENT
      • NAME_COMPARATOR

        public static final java.util.Comparator<Clazz> NAME_COMPARATOR
    • 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
      • parseDescriptor

        public void parseDescriptor​(java.lang.String descriptor,
                                    int modifiers)
        This method parses a descriptor and adds the package of the descriptor to the referenced packages. The syntax of the descriptor is:
         descriptor ::= ( '(' reference * ')' )? reference reference ::= 'L'
         classname ( '<' references '>' )? ';' | 'B' | 'Z' | ... | '+' | '-'
         | '['
         
        This methods uses heavy recursion to parse the descriptor and a roving pointer to limit the creation of string objects.
        Parameters:
        descriptor - The to be parsed descriptor
        modifiers -
      • getAbsolutePath

        public java.lang.String getAbsolutePath()
      • getSourceFile

        public java.lang.String getSourceFile()
      • reset

        public void reset()
        .class construct for different compilers sun 1.1 Detect static variable class$com$acme$MyClass 1.2 " 1.3 " 1.4 " 1.5 ldc_w (class) 1.6 " eclipse 1.1 class$0, ldc (string), invokestatic Class.forName 1.2 " 1.3 " 1.5 ldc (class) 1.6 " 1.5 and later is not an issue, sun pre 1.5 is easy to detect the static variable that decodes the class name. For eclipse, the class$0 gives away we have a reference encoded in a string. compilerversions/compilerversions.jar contains test versions of all versions/compilers.
      • 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()
      • isModule

        public boolean isModule()
      • 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()
      • getMethodDef

        public Clazz.MethodDef getMethodDef​(int access,
                                            java.lang.String name,
                                            java.lang.String descriptor)
        To provide an enclosing instance
        Parameters:
        access -
        name -
        descriptor -
      • getFQN

        public java.lang.String getFQN()
      • setInnerAccess

        public void setInnerAccess​(int access)
      • isFinal

        public boolean isFinal()
      • setDeprecated

        public void setDeprecated​(boolean b)
      • isDeprecated

        public boolean isDeprecated()
      • isAnnotation

        public boolean isAnnotation()
      • getClassSignature

        public java.lang.String getClassSignature()
      • getDefaults

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