Package com.thoughtworks.qdox.library
Class JavaClassContext
- java.lang.Object
-
- com.thoughtworks.qdox.library.JavaClassContext
-
- All Implemented Interfaces:
java.io.Serializable
public class JavaClassContext extends java.lang.Object implements java.io.Serializable
JavaClassContext gives you a mechanism to get aJavaClass
. 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,JavaClass>
classMap
private java.util.Map<java.lang.String,JavaPackage>
packageMap
private java.util.Set<JavaSource>
sourceSet
-
Constructor Summary
Constructors Constructor Description JavaClassContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(JavaClass javaClass)
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 contextJavaClass
getClassByName(java.lang.String name)
Retrieve theJavaClass
based on thename
.java.util.List<JavaClass>
getClasses()
Return all stored JavaClassesJavaPackage
getPackageByName(java.lang.String name)
Retrieve theJavaPackage
based on thename
.java.util.List<JavaPackage>
getPackages()
Return all stored JavaPackagesjava.util.List<JavaSource>
getSources()
Return all stored JavaSourcesJavaClass
removeClassByName(java.lang.String name)
Remove and return theJavaClass
based on thename
.JavaPackage
removePackageByName(java.lang.String name)
Remove and return theJavaPackage
based on thename
.
-
-
-
Field Detail
-
classMap
private java.util.Map<java.lang.String,JavaClass> classMap
-
packageMap
private java.util.Map<java.lang.String,JavaPackage> packageMap
-
sourceSet
private java.util.Set<JavaSource> sourceSet
-
-
Method Detail
-
getClassByName
public JavaClass getClassByName(java.lang.String name)
Retrieve theJavaClass
based on thename
.- Parameters:
name
- the fully qualified name of the class- Returns:
- the stored JavaClass, otherwise
null
-
removeClassByName
public JavaClass removeClassByName(java.lang.String name)
Remove and return theJavaClass
based on thename
.- Parameters:
name
- the fully qualified name of the class- Returns:
- the removed JavaClass, otherwise
null
-
getClasses
public java.util.List<JavaClass> getClasses()
Return all stored JavaClasses- Returns:
- a list of JavaClasses, never
null
-
add
public void add(JavaClass javaClass)
Store thisJavaClass
based on its fully qualified name- Parameters:
javaClass
- the JavaClass to add
-
getPackageByName
public JavaPackage getPackageByName(java.lang.String name)
Retrieve theJavaPackage
based on thename
.- Parameters:
name
- the fully qualified name of the package- Returns:
- the stored JavaPackage, otherwise
null
-
removePackageByName
public JavaPackage removePackageByName(java.lang.String name)
Remove and return theJavaPackage
based on thename
.- Parameters:
name
- the fully qualified name of the class- Returns:
- the removed JavaPackage, otherwise
null
-
add
public void add(JavaPackage jPackage)
A null-safe implementation to store aJavaPackage
in this context- Parameters:
jPackage
- the JavaPackage to add
-
getPackages
public java.util.List<JavaPackage> getPackages()
Return all stored JavaPackages- Returns:
- a list of JavaPackages, never
null
-
add
public void add(JavaSource source)
Store aJavaSource
in this context- Parameters:
source
- the JavaSource to add
-
getSources
public java.util.List<JavaSource> getSources()
Return all stored JavaSources- Returns:
- a list of JavaSources, never
null
-
-