Class ClassSourceLocator

java.lang.Object
org.jibx.custom.classes.ClassSourceLocator
All Implemented Interfaces:
IClassSourceLocator, IClassLocator

public class ClassSourceLocator extends Object implements IClassSourceLocator
Locator that supports both class file lookup and source file lookup.
Author:
Dennis M. Sosnoski
  • Field Details

    • m_sourcePaths

      private final String[] m_sourcePaths
      Paths for source lookup.
    • m_builder

      private final JavaDocBuilder m_builder
      Source file parser.
    • m_lookupSet

      private final Set m_lookupSet
      Set of classes parsed.
  • Constructor Details

    • ClassSourceLocator

      public ClassSourceLocator(String[] paths)
      Constructor.
      Parameters:
      paths - source lookup paths (may be empty, but not null)
  • Method Details

    • isLookupSupported

      public boolean isLookupSupported()
      Check if class lookup is supported. This always returns true.
      Specified by:
      isLookupSupported in interface IClassLocator
      Returns:
      true
    • getSourceInfo

      public JavaClass getSourceInfo(String name)
      Get the source code information for a class.
      Specified by:
      getSourceInfo in interface IClassSourceLocator
      Parameters:
      name - fully-qualified class name (using '$' as inner class marker)
      Returns:
      source code information, null if not available
    • getClassInfo

      public IClass getClassInfo(String name)
      Get the information for a class.
      Specified by:
      getClassInfo in interface IClassLocator
      Parameters:
      name - fully-qualified class name (using '$' as inner class marker)
      Returns:
      class information, or null if not found
    • getRequiredClassInfo

      public IClass getRequiredClassInfo(String name)
      Get required class information. If the class cannot be found a runtime exception is thrown.
      Specified by:
      getRequiredClassInfo in interface IClassLocator
      Parameters:
      name - fully-qualified name of class to be found
      Returns:
      class information
    • loadClass

      public Class loadClass(String name)
      Load class.
      Specified by:
      loadClass in interface IClassLocator
      Parameters:
      name - fully-qualified class name
      Returns:
      loaded class, or null if not found