Package com.thoughtworks.qdox.model.impl
Class DefaultJavaPackage
java.lang.Object
com.thoughtworks.qdox.model.impl.AbstractJavaModel
com.thoughtworks.qdox.model.impl.AbstractBaseJavaEntity
com.thoughtworks.qdox.model.impl.DefaultJavaPackage
- All Implemented Interfaces:
JavaAnnotatedElement
,JavaModel
,JavaPackage
,Serializable
The default implementation of
JavaPackage
, representing a Package
.- Since:
- 1.9
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
getClassByName
(String name) Try to get any class of this package by name.Returns all the classes found for the package.TheClassLibrary
of this package.getName()
Equivalent ofPackage.getName()
The parent of this package For instance: the package ofjava.lang.reflect
isjava.lang
For instance: one of the children ofjava.lang
would bejava.lang.reflect
int
hashCode()
void
setClassLibrary
(ClassLibrary classLibrary) void
toString()
Equivalent ofPackage.toString()
Methods inherited from class com.thoughtworks.qdox.model.impl.AbstractBaseJavaEntity
getAnnotations, getComment, getDeclaringClass, getNamedParameter, getSource, getTagByName, getTags, getTagsByName, setAnnotations, setComment, setSource, setTags
Methods inherited from class com.thoughtworks.qdox.model.impl.AbstractJavaModel
getLineNumber, getModelWriter, setLineNumber, setModelWriterFactory
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.thoughtworks.qdox.model.JavaAnnotatedElement
getAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByName
Methods inherited from interface com.thoughtworks.qdox.model.JavaModel
getLineNumber
-
Field Details
-
classLibrary
-
name
-
classes
-
-
Constructor Details
-
DefaultJavaPackage
- Parameters:
name
- the name of the package, should never benull
-
-
Method Details
-
getName
Equivalent ofPackage.getName()
- Specified by:
getName
in interfaceJavaPackage
- Returns:
- the name, should never be
null
-
setName
-
getCodeBlock
- Specified by:
getCodeBlock
in interfaceJavaModel
- Returns:
- the codeblock
-
setClassLibrary
-
getJavaClassLibrary
TheClassLibrary
of this package.- Specified by:
getJavaClassLibrary
in interfaceJavaPackage
- Returns:
- the classLibrary, should never be
null
-
addClass
-
getClasses
Returns all the classes found for the package.- Specified by:
getClasses
in interfaceJavaPackage
- Returns:
- all the classes found for the package, never
null
-
getClassByName
Try to get any class of this package by name. The name can be both the fully qualified name or just the name of the class.- Specified by:
getClassByName
in interfaceJavaPackage
- Parameters:
name
- the (fully qualified) name of the class- Returns:
- the matching class, otherwise
null
-
getParentPackage
The parent of this package For instance: the package ofjava.lang.reflect
isjava.lang
- Specified by:
getParentPackage
in interfaceJavaPackage
- Returns:
- the parent package, otherwise
null
-
getSubPackages
For instance: one of the children ofjava.lang
would bejava.lang.reflect
- Specified by:
getSubPackages
in interfaceJavaPackage
- Returns:
- all the children of this package , never
null
-
equals
-
hashCode
public int hashCode() -
toString
Description copied from interface:JavaPackage
Equivalent ofPackage.toString()
- Specified by:
toString
in interfaceJavaPackage
- Overrides:
toString
in classObject
- Returns:
- the string representation of the package.
-