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
Modifier and TypeMethodDescriptiongetClassByName
(String name) Try to get any class of this source by name.A List with all direct classes of this source, nevernull
If there's a package, return the packageName, followed by a dot, otherwise an empty StringComplete code representation of this sourceRetrieve all the importgetNestedClassByName
(String name) Try to get the JavaClass child based on its name relative to the package.The package of this source ornull
Returns the name of the package or an empty String if there's no packagegetURL()
-
Method Details
-
getURL
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
Retrieve all the import- Returns:
- the imports, never
null
-
getClasses
A List with all direct classes of this source, nevernull
- Returns:
- a list of JavaClasses, never
null
-
getCodeBlock
String getCodeBlock()Complete code representation of this source- Returns:
- the code block of this source
-
getClassNamePrefix
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
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
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
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
-