Package com.thoughtworks.qdox.model
Interface JavaSource
-
- All Known Implementing Classes:
DefaultJavaSource
public interface JavaSource
The root of every JavaModel, even for those based on binary classes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JavaClass
getClassByName(java.lang.String name)
Try to get any class of this source by name.java.util.List<JavaClass>
getClasses()
A List with all direct classes of this source, nevernull
java.lang.String
getClassNamePrefix()
If there's a package, return the packageName, followed by a dot, otherwise an empty Stringjava.lang.String
getCodeBlock()
Complete code representation of this sourcejava.util.List<java.lang.String>
getImports()
Retrieve all the importClassLibrary
getJavaClassLibrary()
JavaClass
getNestedClassByName(java.lang.String name)
Try to get the JavaClass child based on its name relative to the package.JavaPackage
getPackage()
The package of this source ornull
java.lang.String
getPackageName()
Returns the name of the package or an empty String if there's no packagejava.net.URL
getURL()
-
-
-
Method Detail
-
getURL
java.net.URL getURL()
- Returns:
- the URL of the source file
- Since:
- 1.4
-
getPackage
JavaPackage getPackage()
The package of this source ornull
- Returns:
- the package
-
getImports
java.util.List<java.lang.String> getImports()
Retrieve all the import- Returns:
- the imports, never
null
-
getClasses
java.util.List<JavaClass> getClasses()
A List with all direct classes of this source, nevernull
- Returns:
- a list of JavaClasses, never
null
-
getCodeBlock
java.lang.String getCodeBlock()
Complete code representation of this source- Returns:
- the code block of this source
-
getClassNamePrefix
java.lang.String getClassNamePrefix()
If there's a package, return the packageName, followed by a dot, otherwise an empty String- Returns:
- the class name prefix, otherwise an empty String
-
getNestedClassByName
JavaClass getNestedClassByName(java.lang.String name)
Try to get the JavaClass child based on its name relative to the package. This doesn't try to resolve it by recursion.- Parameters:
name
- the name of the class- Returns:
- the resolved JavaClass, otherwise
null
-
getClassByName
JavaClass getClassByName(java.lang.String name)
Try to get any class of this source by name. The name can be both the fully qualified name or just the name of the class.- Parameters:
name
- the (fully qualified) name of the class- Returns:
- the matching class, otherwise
null
- Since:
- 2.0
-
getJavaClassLibrary
ClassLibrary getJavaClassLibrary()
-
getPackageName
java.lang.String getPackageName()
Returns the name of the package or an empty String if there's no package- Returns:
- the package name, otherwise an empty String
-
-