Package com.thoughtworks.qdox.library
Class JavaClassContext
java.lang.Object
com.thoughtworks.qdox.library.JavaClassContext
- All Implemented Interfaces:
Serializable
JavaClassContext gives you a mechanism to get a
JavaClass
.
If a class couldn't be found in the cache, the class will be pulled from the classLibrary, the builder will create the corresponding JavaClass and put it in the cache.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Store thisJavaClass
based on its fully qualified namevoid
add
(JavaPackage jPackage) A null-safe implementation to store aJavaPackage
in this contextvoid
add
(JavaSource source) Store aJavaSource
in this contextgetClassByName
(String name) Retrieve theJavaClass
based on thename
.Return all stored JavaClassesgetPackageByName
(String name) Retrieve theJavaPackage
based on thename
.Return all stored JavaPackagesReturn all stored JavaSourcesremoveClassByName
(String name) Remove and return theJavaClass
based on thename
.removePackageByName
(String name) Remove and return theJavaPackage
based on thename
.
-
Field Details
-
classMap
-
packageMap
-
sourceSet
-
-
Constructor Details
-
JavaClassContext
public JavaClassContext()
-
-
Method Details
-
getClassByName
Retrieve theJavaClass
based on thename
.- Parameters:
name
- the fully qualified name of the class- Returns:
- the stored JavaClass, otherwise
null
-
removeClassByName
Remove and return theJavaClass
based on thename
.- Parameters:
name
- the fully qualified name of the class- Returns:
- the removed JavaClass, otherwise
null
-
getClasses
Return all stored JavaClasses- Returns:
- a list of JavaClasses, never
null
-
add
Store thisJavaClass
based on its fully qualified name- Parameters:
javaClass
- the JavaClass to add
-
getPackageByName
Retrieve theJavaPackage
based on thename
.- Parameters:
name
- the fully qualified name of the package- Returns:
- the stored JavaPackage, otherwise
null
-
removePackageByName
Remove and return theJavaPackage
based on thename
.- Parameters:
name
- the fully qualified name of the class- Returns:
- the removed JavaPackage, otherwise
null
-
add
A null-safe implementation to store aJavaPackage
in this context- Parameters:
jPackage
- the JavaPackage to add
-
getPackages
Return all stored JavaPackages- Returns:
- a list of JavaPackages, never
null
-
add
Store aJavaSource
in this context- Parameters:
source
- the JavaSource to add
-
getSources
Return all stored JavaSources- Returns:
- a list of JavaSources, never
null
-