| Modifier and Type | Field and Description |
|---|---|
| private List | annotations
Lazily created list of package annotations. |
| private final Map | classes
List of classes contained within this package keyed by their name. |
| private JDocComment | jdoc
package javadoc. |
| private String | name
Name of the package. |
| private final JCodeModel | |
| private final Set | resources
List of resources files inside this package. |
| private final Map | upperCaseClassMap
All |
| Access | Constructor and Description |
|---|---|
| pack-priv | JPackage(String
Name of package name, JCodeModel The code writer being used to create this package cw)JPackage constructor |
| Modifier and Type | Method and Description |
|---|---|
| public JDefinedClass | Returns: newly created Annotation Type DeclarationName of the annotation Type declaration to be added to this package name)Implements com. Add an annotationType Declaration to this package |
| public JDefinedClass | Returns: Newly generated classModifiers for this class declaration mods, String Name of class to be added to this package name)Implements com. Add a class to this package. |
| public JDefinedClass | _class(int mods, String name, boolean isInterface)
Implements com.
Deprecated
Create a new class or a new interface. |
| public JDefinedClass | _class(int mods, String name, ClassType classTypeVal)
Implements com. Creates a new class/enum/interface/annotation. |
| public JDefinedClass | _class(String name)
Implements com. Adds a public class to this package. |
| public JDefinedClass | Returns: newly created EnumName of the enum to be added to this package name)Implements com. Add a public enum to this package |
| public JDefinedClass | Returns: null If the class is not yet created.Gets a reference to the already created |
| public JDefinedClass | Returns: Newly generated interfaceModifiers for this interface declaration mods, String Name of interface to be added to this package name)Implements com. Add an interface to this package. |
| public JDefinedClass | _interface(String name)
Implements com. Adds a public interface to this package. |
| public JResourceFile | |
| public JAnnotationUse | annotate(JClass clazz)
Implements com. Adds an annotation to this program element. |
| public JAnnotationUse | annotate(Class<? extends Annotation> clazz)
Implements com. Adds an annotation to this program element. |
| public <W extends JAnnotationWriter | annotate2(Class<W> clazz)
Implements com. Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations. |
| public Collection | annotations()
Implements com. Read-only live view of all annotations on this |
| pack-priv void | |
| public Iterator | classes()
Implements com. Returns an iterator that walks the top-level classes defined in this package. |
| public int | compareTo(JPackage that)
Implements java. Order is based on the lexicological order of the package name. |
| pack-priv int | |
| private JFormatter | |
| public void | |
| public void | |
| public JPackage | getPackage()
Implements com. Gets the nearest package parent. |
| public boolean | Returns: true if this package contains any classes
or false otherwise.Checks if this package contains any classes. |
| public boolean | |
| public boolean | isClass()
Implements com. Returns true if the container is a class. |
| public boolean | |
| public boolean | isPackage()
Implements com. Returns true if the container is a package. |
| public boolean | |
| public JDocComment | Returns: JDocComment containing javadocs for this classImplements com. Creates, if necessary, and returns the package javadoc for this JDefinedClass. |
| public String | Returns: The name of this package, or the empty string if this is the null package. For example, this method returns strings like"java.lang"Get the name of this package |
| public JCodeModel | owner()
Implements com. Return the code model root object being used to create this package. |
| public JPackage | |
| public JClassContainer | parentContainer()
Implements com. Parent JClassContainer. |
| public Iterator | |
| public JClass | |
| public void | |
| public boolean | removeAnnotation(JAnnotationUse annotation)
Implements com. Removes annotation from this program element. |
| public JPackage | |
| pack-priv File |
| annotations | back to summary |
|---|---|
| private List<JAnnotationUse> annotations Lazily created list of package annotations. | |
| classes | back to summary |
|---|---|
| private final Map<String, JDefinedClass> classes List of classes contained within this package keyed by their name. | |
| jdoc | back to summary |
|---|---|
| private JDocComment jdoc package javadoc. | |
| name | back to summary |
|---|---|
| private String name Name of the package. May be the empty string for the root package. | |
| owner | back to summary |
|---|---|
| private final JCodeModel owner | |
| resources | back to summary |
|---|---|
| private final Set<JResourceFile> resources List of resources files inside this package. | |
| upperCaseClassMap | back to summary |
|---|---|
| private final Map<String, JDefinedClass> upperCaseClassMap All | |
| JPackage | back to summary |
|---|---|
| pack-priv JPackage(String name, JCodeModel cw) JPackage constructor
| |
| _annotationTypeDeclaration | back to summary |
|---|---|
| public JDefinedClass _annotationTypeDeclaration(String name) throws JClassAlreadyExistsException Implements com. Add an annotationType Declaration to this package
| |
| _class | back to summary |
|---|---|
| public JDefinedClass _class(int mods, String name) throws JClassAlreadyExistsException Implements com. Add a class to this package.
| |
| _class | back to summary |
|---|---|
| public JDefinedClass _class(int mods, String name, boolean isInterface) throws JClassAlreadyExistsException Implements com. Doc from com. Deprecated
Create a new class or a new interface.
| |
| _class | back to summary |
|---|---|
| public JDefinedClass _class(int mods, String name, ClassType classTypeVal) throws JClassAlreadyExistsException Implements com. Doc from com. Creates a new class/enum/interface/annotation.
| |
| _class | back to summary |
|---|---|
| public JDefinedClass _class(String name) throws JClassAlreadyExistsException Implements com. Adds a public class to this package.
| |
| _enum | back to summary |
|---|---|
| public JDefinedClass _enum(String name) throws JClassAlreadyExistsException Implements com. Add a public enum to this package
| |
| _getClass | back to summary |
|---|---|
| public JDefinedClass _getClass(String name) Gets a reference to the already created
| |
| _interface | back to summary |
|---|---|
| public JDefinedClass _interface(int mods, String name) throws JClassAlreadyExistsException Implements com. Add an interface to this package.
| |
| _interface | back to summary |
|---|---|
| public JDefinedClass _interface(String name) throws JClassAlreadyExistsException Implements com. Adds a public interface to this package.
| |
| addResourceFile | back to summary |
|---|---|
| public JResourceFile addResourceFile(JResourceFile rsrc) Adds a new resource file to this package. | |
| annotate | back to summary |
|---|---|
| public JAnnotationUse annotate(JClass clazz) Implements com. Doc from com. Adds an annotation to this program element.
| |
| annotate | back to summary |
|---|---|
| public JAnnotationUse annotate(Class<? extends Annotation> clazz) Implements com. Doc from com. Adds an annotation to this program element.
| |
| annotate2 | back to summary |
|---|---|
| public <W extends JAnnotationWriter Implements com. Doc from com. Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.
| |
| annotations | back to summary |
|---|---|
| public Collection Implements com. Doc from com. Read-only live view of all annotations on this
| |
| build | back to summary |
|---|---|
| pack-priv void build(CodeWriter src, CodeWriter res) throws IOException | |
| classes | back to summary |
|---|---|
| public Iterator Implements com. Returns an iterator that walks the top-level classes defined in this package.
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(JPackage that) Implements java. Order is based on the lexicological order of the package name.
| |
| countArtifacts | back to summary |
|---|---|
| pack-priv int countArtifacts() | |
| createJavaSourceFileWriter | back to summary |
|---|---|
| private JFormatter createJavaSourceFileWriter(CodeWriter src, String className) throws IOException | |
| declare | back to summary |
|---|---|
| public void declare(JFormatter f) Implements com.
| |
| generate | back to summary |
|---|---|
| public void generate(JFormatter f) Implements com.
| |
| getPackage | back to summary |
|---|---|
| public JPackage getPackage() Implements com. Doc from com. Gets the nearest package parent.
If
| |
| hasClasses | back to summary |
|---|---|
| public boolean hasClasses() Checks if this package contains any classes.
| |
| hasResourceFile | back to summary |
|---|---|
| public boolean hasResourceFile(String name) Checks if a resource of the given name exists. | |
| isClass | back to summary |
|---|---|
| public boolean isClass() Implements com. Doc from com. Returns true if the container is a class.
| |
| isDefined | back to summary |
|---|---|
| public boolean isDefined(String classLocalName) Checks if a given name is already defined as a class/interface | |
| isPackage | back to summary |
|---|---|
| public boolean isPackage() Implements com. Doc from com. Returns true if the container is a package.
| |
| isUnnamed | back to summary |
|---|---|
| public boolean isUnnamed() Checks if this package is the root, unnamed package. | |
| javadoc | back to summary |
|---|---|
| public JDocComment javadoc() Implements com. Creates, if necessary, and returns the package javadoc for this JDefinedClass.
| |
| name | back to summary |
|---|---|
| public String name() Get the name of this package
| |
| owner | back to summary |
|---|---|
| public JCodeModel owner() Implements com. Return the code model root object being used to create this package.
| |
| parent | back to summary |
|---|---|
| public JPackage parent() Gets the parent package, or null if this class is the root package. | |
| parentContainer | back to summary |
|---|---|
| public JClassContainer parentContainer() Implements com. Doc from com. Parent JClassContainer. If this is a package, this method returns a parent package, or null if this package is the root package. If this is an outer-most class, this method returns a package to which it belongs. If this is an inner class, this method returns the outer class.
| |
| propertyFiles | back to summary |
|---|---|
| public Iterator Iterates all resource files in this package. | |
| ref | back to summary |
|---|---|
| public JClass ref(String name) throws ClassNotFoundException Reference a class within this package. | |
| remove | back to summary |
|---|---|
| public void remove(JClass c) Removes a class from this package. | |
| removeAnnotation | back to summary |
|---|---|
| public boolean removeAnnotation(JAnnotationUse annotation) Implements com. Doc from com. Removes annotation from this program element.
| |
| subPackage | back to summary |
|---|---|
| public JPackage subPackage(String pkg) Gets a reference to a sub package of this package. | |
| toPath | back to summary |
|---|---|
| pack-priv File toPath(File dir) Convert the package name to directory path equivalent | |