Package org.jibx.custom.classes
Class ClassSourceLocator
- java.lang.Object
-
- org.jibx.custom.classes.ClassSourceLocator
-
- All Implemented Interfaces:
IClassSourceLocator
,IClassLocator
public class ClassSourceLocator extends java.lang.Object implements IClassSourceLocator
Locator that supports both class file lookup and source file lookup.- Author:
- Dennis M. Sosnoski
-
-
Field Summary
Fields Modifier and Type Field Description private JavaDocBuilder
m_builder
Source file parser.private java.util.Set
m_lookupSet
Set of classes parsed.private java.lang.String[]
m_sourcePaths
Paths for source lookup.
-
Constructor Summary
Constructors Constructor Description ClassSourceLocator(java.lang.String[] paths)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IClass
getClassInfo(java.lang.String name)
Get the information for a class.IClass
getRequiredClassInfo(java.lang.String name)
Get required class information.JavaClass
getSourceInfo(java.lang.String name)
Get the source code information for a class.boolean
isLookupSupported()
Check if class lookup is supported.java.lang.Class
loadClass(java.lang.String name)
Load class.
-
-
-
Method Detail
-
isLookupSupported
public boolean isLookupSupported()
Check if class lookup is supported. This always returnstrue
.- Specified by:
isLookupSupported
in interfaceIClassLocator
- Returns:
true
-
getSourceInfo
public JavaClass getSourceInfo(java.lang.String name)
Get the source code information for a class.- Specified by:
getSourceInfo
in interfaceIClassSourceLocator
- Parameters:
name
- fully-qualified class name (using '$' as inner class marker)- Returns:
- source code information,
null
if not available
-
getClassInfo
public IClass getClassInfo(java.lang.String name)
Get the information for a class.- Specified by:
getClassInfo
in interfaceIClassLocator
- Parameters:
name
- fully-qualified class name (using '$' as inner class marker)- Returns:
- class information, or
null
if not found
-
getRequiredClassInfo
public IClass getRequiredClassInfo(java.lang.String name)
Get required class information. If the class cannot be found a runtime exception is thrown.- Specified by:
getRequiredClassInfo
in interfaceIClassLocator
- Parameters:
name
- fully-qualified name of class to be found- Returns:
- class information
-
loadClass
public java.lang.Class loadClass(java.lang.String name)
Load class.- Specified by:
loadClass
in interfaceIClassLocator
- Parameters:
name
- fully-qualified class name- Returns:
- loaded class, or
null
if not found
-
-