java.lang.Object
com.thoughtworks.qdox.library.AbstractClassLibrary
com.thoughtworks.qdox.library.SourceLibrary
- 所有已实现的接口:
ClassLibrary,Serializable
- 直接已知子类:
SourceFolderLibrary
This Library will immediately parse the source and keeps its reference to a private context.
Once the superclass explicitly asks for an instance if will be moved to the context f the supoerclass.
If there's a request to get a certain JavaModel Object from a SourceLibrary, it will check all ancestor SourceLibraries as well.
- 从以下版本开始:
- 2.0
- 作者:
- Robert Scholte
- 另请参阅:
-
构造器概要
构造器构造器说明SourceLibrary(AbstractClassLibrary parent) Create a new instance of SourceLibrary and chain it to the parent -
方法概要
修饰符和类型方法说明Add aFilecontaining java code to this libraryaddSource(InputStream stream) Add anInputStreamcontaining java code to this libraryAdd aReadercontaining java code to this libraryAdd aURLcontaining java code to this libraryprotected booleancontainsClassReference(String name) This method is used to detect if there's a match with this classname.final Stringfinal ErrorHandlerGet all classes, including those from parent SourceLibrariesGet all packages, including those from parent SourceLibrariesGet all sources, including those from parent SourceLibrariesfinal booleanfinal booleanprotected final voidregisterJavaSource(JavaSource source) protected JavaClassresolveJavaClass(String name) The implementation should check it's sources to see if it can build a JavaClass Model If not, just return null; Once found it will be mapped, so there's no need to keep a reference to this object.protected JavaPackageresolveJavaPackage(String name) final voidsetDebugLexer(boolean debugLexer) Use the Lexer in debug modefinal voidsetDebugParser(boolean debugParser) Use the Parser in debug modefinal voidsetEncoding(String encoding) Sets the encoding to use when parsing a URL or InputStreamReaderfinal voidsetErrorHandler(ErrorHandler errorHandler) 从类继承的方法 com.thoughtworks.qdox.library.AbstractClassLibrary
getJavaClass, getJavaClass, getJavaClasses, getJavaModules, getJavaPackage, getJavaPackages, getJavaSources, getModelBuilder, getModelBuilder, getModelBuilderFactory, getModelWriterFactory, hasClassReference, setModelBuilderFactory, setModelWriterFactory
-
构造器详细资料
-
SourceLibrary
Create a new instance of SourceLibrary and chain it to the parent- 参数:
parent- the parent classLibrary
-
-
方法详细资料
-
addSource
Add aReadercontaining java code to this library- 参数:
reader- aReaderwhich should contain java code- 返回:
- The constructed
JavaSourceobject of this reader - 抛出:
ParseException- if this content couldn't be parsed to a JavaModel
-
addSource
Add anInputStreamcontaining java code to this library- 参数:
stream- anInputStreamwhich should contain java code- 返回:
- The constructed
JavaSourceobject of this stream - 抛出:
ParseException- if this content couldn't be parsed to a JavaModelIOException- if an IOException occurs
-
addSource
Add aURLcontaining java code to this library- 参数:
url- aURLwhich should contain java code- 返回:
- The constructed
JavaSourceobject of this url - 抛出:
ParseException- if this content couldn't be parsed to a JavaModelIOException- if an IOException occurs
-
addSource
Add aFilecontaining java code to this library- 参数:
file- aFilewhich should contain java code- 返回:
- The constructed
JavaSourceobject of this file - 抛出:
ParseException- if this content couldn't be parsed to a JavaModelIOException- if an IOException occurs
-
resolveJavaClass
从类复制的说明:AbstractClassLibraryThe implementation should check it's sources to see if it can build a JavaClass Model If not, just return null; Once found it will be mapped, so there's no need to keep a reference to this object.- 指定者:
resolveJavaClass在类中AbstractClassLibrary- 参数:
name- the fully qualified name- 返回:
- the resolved JavaClass, otherwise
null
-
resolveJavaPackage
- 指定者:
resolveJavaPackage在类中AbstractClassLibrary
-
registerJavaSource
- 参数:
source- the source, might benull
-
setDebugLexer
public final void setDebugLexer(boolean debugLexer) Use the Lexer in debug mode- 参数:
debugLexer- the debug logging flag
-
isDebugLexer
public final boolean isDebugLexer() -
setDebugParser
public final void setDebugParser(boolean debugParser) Use the Parser in debug mode- 参数:
debugParser- the debug logging flag
-
isDebugParser
public final boolean isDebugParser() -
setEncoding
Sets the encoding to use when parsing a URL or InputStreamReader- 参数:
encoding- the source encoding
-
getEncoding
-
setErrorHandler
-
getErrorHandler
-
getJavaClasses
Get all classes, including those from parent SourceLibraries- 指定者:
getJavaClasses在接口中ClassLibrary- 覆盖:
getJavaClasses在类中AbstractClassLibrary- 返回:
- all JavaClasses of this ClassLibrary
-
getJavaPackages
Get all packages, including those from parent SourceLibraries- 指定者:
getJavaPackages在接口中ClassLibrary- 覆盖:
getJavaPackages在类中AbstractClassLibrary- 返回:
- all JavaPackages of this ClassLibrary
-
getJavaSources
Get all sources, including those from parent SourceLibraries- 指定者:
getJavaSources在接口中ClassLibrary- 覆盖:
getJavaSources在类中AbstractClassLibrary- 返回:
- all JavaSources as a List, never
null
-
containsClassReference
从类复制的说明:AbstractClassLibraryThis method is used to detect if there's a match with this classname. The name could be constructed based on imports and inner class paths.- 指定者:
containsClassReference在类中AbstractClassLibrary- 参数:
name- the fully qualified name of the class- 返回:
- true if this ClassLibrary has a reference to this class.
-