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 TypeMethodDescriptionvoidbooleangetClassByName(String name) Try to get any class of this package by name.Returns all the classes found for the package.TheClassLibraryof this package.getName()Equivalent ofPackage.getName()The parent of this package For instance: the package ofjava.lang.reflectisjava.langFor instance: one of the children ofjava.langwould bejava.lang.reflectinthashCode()voidsetClassLibrary(ClassLibrary classLibrary) voidtoString()Equivalent ofPackage.toString()Methods inherited from class com.thoughtworks.qdox.model.impl.AbstractBaseJavaEntity
getAnnotations, getComment, getDeclaringClass, getNamedParameter, getSource, getTagByName, getTags, getTagsByName, setAnnotations, setComment, setSource, setTagsMethods inherited from class com.thoughtworks.qdox.model.impl.AbstractJavaModel
getLineNumber, getModelWriter, setLineNumber, setModelWriterFactoryMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.thoughtworks.qdox.model.JavaAnnotatedElement
getAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByNameMethods 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:
getNamein interfaceJavaPackage- Returns:
- the name, should never be
null
-
setName
-
getCodeBlock
- Specified by:
getCodeBlockin interfaceJavaModel- Returns:
- the codeblock
-
setClassLibrary
-
getJavaClassLibrary
TheClassLibraryof this package.- Specified by:
getJavaClassLibraryin interfaceJavaPackage- Returns:
- the classLibrary, should never be
null
-
addClass
-
getClasses
Returns all the classes found for the package.- Specified by:
getClassesin 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:
getClassByNamein 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.reflectisjava.lang- Specified by:
getParentPackagein interfaceJavaPackage- Returns:
- the parent package, otherwise
null
-
getSubPackages
For instance: one of the children ofjava.langwould bejava.lang.reflect- Specified by:
getSubPackagesin interfaceJavaPackage- Returns:
- all the children of this package , never
null
-
equals
-
hashCode
public int hashCode() -
toString
Description copied from interface:JavaPackageEquivalent ofPackage.toString()- Specified by:
toStringin interfaceJavaPackage- Overrides:
toStringin classObject- Returns:
- the string representation of the package.
-