Class ScanResultObject

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void findReferencedClassInfo​(java.util.Map<java.lang.String,​ClassInfo> classNameToClassInfo, java.util.Set<ClassInfo> refdClassInfo, LogNode log)
      Get ClassInfo objects for any classes referenced by this object.
      (package private) java.util.Set<ClassInfo> findReferencedClassInfo​(LogNode log)
      Get ClassInfo objects for any classes referenced by this object.
      (package private) ClassInfo getClassInfo()
      Get the ClassInfo object for the referenced class, or null if the referenced class was not encountered during scanning (i.e.
      private java.lang.String getClassInfoNameOrClassName()
      Get the class name by calling getClassInfo().getName(), or as a fallback, by calling getClassName().
      protected abstract java.lang.String getClassName()
      The name of the class (used by getClassInfo() to fetch the ClassInfo object for the class).
      (package private) java.lang.Class<?> loadClass()
      Load the class named returned by getClassInfo(), or if that returns null, the class named by getClassName().
      (package private) java.lang.Class<?> loadClass​(boolean ignoreExceptions)
      Load the class named returned by getClassInfo(), or if that returns null, the class named by getClassName().
      (package private) <T> java.lang.Class<T> loadClass​(java.lang.Class<T> superclassOrInterfaceType)
      Load the class named returned by getClassInfo(), or if that returns null, the class named by getClassName().
      (package private) <T> java.lang.Class<T> loadClass​(java.lang.Class<T> superclassOrInterfaceType, boolean ignoreExceptions)
      Load the class named returned by getClassInfo(), or if that returns null, the class named by getClassName().
      (package private) void setScanResult​(ScanResult scanResult)
      Set ScanResult backreferences in info objects after scan has completed.
      java.lang.String toString()
      Render to string.
      (package private) java.lang.String toString​(boolean useSimpleNames)
      Render to string, with simple names for classes if useSimpleNames is true.
      protected abstract void toString​(boolean useSimpleNames, java.lang.StringBuilder buf)
      Render to string.
      java.lang.String toStringWithSimpleNames()
      Render to string, using only simple names for classes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • scanResult

        protected transient ScanResult scanResult
        The scan result.
      • classRef

        protected transient java.lang.Class<?> classRef
        The class ref, once the class is loaded.
    • Constructor Detail

      • ScanResultObject

        ScanResultObject()
    • Method Detail

      • setScanResult

        void setScanResult​(ScanResult scanResult)
        Set ScanResult backreferences in info objects after scan has completed.
        Parameters:
        scanResult - the scan result
      • findReferencedClassInfo

        final java.util.Set<ClassInfo> findReferencedClassInfo​(LogNode log)
        Get ClassInfo objects for any classes referenced by this object.
        Parameters:
        log - the log
        Returns:
        the referenced class info.
      • findReferencedClassInfo

        protected void findReferencedClassInfo​(java.util.Map<java.lang.String,​ClassInfo> classNameToClassInfo,
                                               java.util.Set<ClassInfo> refdClassInfo,
                                               LogNode log)
        Get ClassInfo objects for any classes referenced by this object.
        Parameters:
        classNameToClassInfo - the map from class name to ClassInfo.
        refdClassInfo - the referenced class info
        log - the log
      • getClassName

        protected abstract java.lang.String getClassName()
        The name of the class (used by getClassInfo() to fetch the ClassInfo object for the class).
        Returns:
        The class name.
      • getClassInfo

        ClassInfo getClassInfo()
        Get the ClassInfo object for the referenced class, or null if the referenced class was not encountered during scanning (i.e. no ClassInfo object was created for the class during scanning). N.B. even if this method returns null, loadClass() may be able to load the referenced class by name.
        Returns:
        The ClassInfo object for the referenced class.
      • getClassInfoNameOrClassName

        private java.lang.String getClassInfoNameOrClassName()
        Get the class name by calling getClassInfo().getName(), or as a fallback, by calling getClassName().
        Returns:
        the class name
      • loadClass

        <T> java.lang.Class<T> loadClass​(java.lang.Class<T> superclassOrInterfaceType,
                                         boolean ignoreExceptions)
        Load the class named returned by getClassInfo(), or if that returns null, the class named by getClassName(). Returns a Class<?> reference for the class, cast to the requested superclass or interface type.
        Type Parameters:
        T - the superclass or interface type
        Parameters:
        superclassOrInterfaceType - The type to cast the resulting class reference to.
        ignoreExceptions - If true, ignore classloading exceptions and return null on failure.
        Returns:
        The Class<?> reference for the referenced class, or null if the class could not be loaded (or casting failed) and ignoreExceptions is true.
        Throws:
        java.lang.IllegalArgumentException - if the class could not be loaded or cast, and ignoreExceptions was false.
      • loadClass

        <T> java.lang.Class<T> loadClass​(java.lang.Class<T> superclassOrInterfaceType)
        Load the class named returned by getClassInfo(), or if that returns null, the class named by getClassName(). Returns a Class<?> reference for the class, cast to the requested superclass or interface type.
        Type Parameters:
        T - the superclass or interface type
        Parameters:
        superclassOrInterfaceType - The type to cast the resulting class reference to.
        Returns:
        The Class<?> reference for the referenced class, or null if the class could not be loaded (or casting failed) and ignoreExceptions is true.
        Throws:
        java.lang.IllegalArgumentException - if the class could not be loaded or cast, and ignoreExceptions was false.
      • loadClass

        java.lang.Class<?> loadClass​(boolean ignoreExceptions)
        Load the class named returned by getClassInfo(), or if that returns null, the class named by getClassName(). Returns a Class<?> reference for the class.
        Parameters:
        ignoreExceptions - If true, ignore classloading exceptions and return null on failure.
        Returns:
        The Class<?> reference for the referenced class, or null if the class could not be loaded and ignoreExceptions is true.
        Throws:
        java.lang.IllegalArgumentException - if the class could not be loaded and ignoreExceptions was false.
      • loadClass

        java.lang.Class<?> loadClass()
        Load the class named returned by getClassInfo(), or if that returns null, the class named by getClassName(). Returns a Class<?> reference for the class.
        Returns:
        The Class<?> reference for the referenced class.
        Throws:
        java.lang.IllegalArgumentException - if the class could not be loaded.
      • toString

        protected abstract void toString​(boolean useSimpleNames,
                                         java.lang.StringBuilder buf)
        Render to string.
        Parameters:
        useSimpleNames - if true, use just the simple name of each class.
        buf - the buf
      • toString

        java.lang.String toString​(boolean useSimpleNames)
        Render to string, with simple names for classes if useSimpleNames is true.
        Parameters:
        useSimpleNames - if true, use just the simple name of each class.
        Returns:
        the string representation.
      • toStringWithSimpleNames

        public java.lang.String toStringWithSimpleNames()
        Render to string, using only simple names for classes.
        Returns:
        the string representation, using simple names for classes.
      • toString

        public java.lang.String toString()
        Render to string.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representation.