Class DefaultJavaSource
java.lang.Object
com.thoughtworks.qdox.model.impl.DefaultJavaSource
- All Implemented Interfaces:
JavaSource, Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultJavaSource(ClassLibrary classLibrary) Default constructor for the Default JavaSource -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidgetClassByName(String name) Try to get any class of this source by name.A List with all direct classes of this source, nevernullIf 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 ornullReturns the name of the package or an empty String if there's no packagegetURL()voidsetModelWriterFactory(ModelWriterFactory modelWriterFactory) voidsetPackage(JavaPackage pkg) voidtoString()
-
Constructor Details
-
DefaultJavaSource
Default constructor for the Default JavaSource- Parameters:
classLibrary- the classLibrary, should not benull
-
-
Method Details
-
setURL
- Parameters:
url- the URL of the source file- Since:
- 1.4
-
getURL
- Specified by:
getURLin interfaceJavaSource- Returns:
- the URL of the source file
-
getPackage
The package of this source ornull- Specified by:
getPackagein interfaceJavaSource- Returns:
- the package
-
setPackage
-
addImport
-
getImports
Retrieve all the import- Specified by:
getImportsin interfaceJavaSource- Returns:
- the imports, never
null
-
addClass
-
getClasses
A List with all direct classes of this source, nevernull- Specified by:
getClassesin interfaceJavaSource- Returns:
- a list of JavaClasses, never
null
-
getCodeBlock
Complete code representation of this source- Specified by:
getCodeBlockin interfaceJavaSource- Returns:
- the code block of this source
-
toString
-
getClassNamePrefix
If there's a package, return the packageName, followed by a dot, otherwise an empty String- Specified by:
getClassNamePrefixin interfaceJavaSource- 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.- Specified by:
getNestedClassByNamein interfaceJavaSource- 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.- Specified by:
getClassByNamein interfaceJavaSource- Parameters:
name- the (fully qualified) name of the class- Returns:
- the matching class, otherwise
null
-
getJavaClassLibrary
- Specified by:
getJavaClassLibraryin interfaceJavaSource
-
getPackageName
Returns the name of the package or an empty String if there's no package- Specified by:
getPackageNamein interfaceJavaSource- Returns:
- the package name, otherwise an empty String
-
setModelWriterFactory
- Parameters:
modelWriterFactory- the modelWriterFactory- Since:
- 2.0
-