public class DefaultJavaPackage extends AbstractBaseJavaEntity implements JavaPackage
JavaPackage
, representing a Package
.Constructor and Description |
---|
DefaultJavaPackage(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
addClass(JavaClass clazz) |
boolean |
equals(java.lang.Object o) |
JavaClass |
getClassByName(java.lang.String name)
Try to get any class of this package by name.
|
java.util.Collection<JavaClass> |
getClasses()
Returns all the classes found for the package.
|
java.lang.String |
getCodeBlock() |
ClassLibrary |
getJavaClassLibrary()
The
ClassLibrary of this package. |
java.lang.String |
getName()
Equivalent of
Package.getName() |
JavaPackage |
getParentPackage()
The parent of this package
For instance: the package of
java.lang.reflect is java.lang |
java.util.List<JavaPackage> |
getSubPackages()
For instance: one of the children of
java.lang would be java.lang.reflect |
int |
hashCode() |
void |
setClassLibrary(ClassLibrary classLibrary) |
void |
setName(java.lang.String name) |
java.lang.String |
toString()
Equivalent of
Package.toString() |
getAnnotations, getComment, getDeclaringClass, getNamedParameter, getSource, getTagByName, getTags, getTagsByName, setAnnotations, setComment, setSource, setTags
getLineNumber, getModelWriter, setLineNumber, setModelWriterFactory
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAnnotations, getComment, getNamedParameter, getTagByName, getTags, getTagsByName
getLineNumber
public DefaultJavaPackage(java.lang.String name)
name
- the name of the package, should never be null
public java.lang.String getName()
Package.getName()
getName
in interface JavaPackage
null
public void setName(java.lang.String name)
public java.lang.String getCodeBlock()
getCodeBlock
in interface JavaModel
public void setClassLibrary(ClassLibrary classLibrary)
public ClassLibrary getJavaClassLibrary()
ClassLibrary
of this package.getJavaClassLibrary
in interface JavaPackage
null
public void addClass(JavaClass clazz)
public java.util.Collection<JavaClass> getClasses()
getClasses
in interface JavaPackage
null
public JavaClass getClassByName(java.lang.String name)
getClassByName
in interface JavaPackage
name
- the (fully qualified) name of the classnull
public JavaPackage getParentPackage()
java.lang.reflect
is java.lang
getParentPackage
in interface JavaPackage
null
public java.util.List<JavaPackage> getSubPackages()
java.lang
would be java.lang.reflect
getSubPackages
in interface JavaPackage
null
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
JavaPackage
Package.toString()
toString
in interface JavaPackage
toString
in class java.lang.Object
Copyright © 2002-2021. All Rights Reserved.