JDefinedClass
, JPackage
public interface JClassContainer
Modifier and Type | Method | Description |
---|---|---|
JDefinedClass |
_annotationTypeDeclaration(String name) |
Add an annotationType Declaration to this package
|
JDefinedClass |
_class(int mods,
String name) |
Add a new class to this package/class.
|
JDefinedClass |
_class(int mods,
String name,
boolean isInterface) |
Deprecated.
|
JDefinedClass |
_class(int mods,
String name,
ClassType kind) |
Creates a new class/enum/interface/annotation.
|
JDefinedClass |
_class(String name) |
Add a new public class to this class/package.
|
JDefinedClass |
_enum(String name) |
Add a public enum to this package
|
JDefinedClass |
_interface(int mods,
String name) |
Add an interface to this class/package.
|
JDefinedClass |
_interface(String name) |
Adds a public interface to this package.
|
Iterator<JDefinedClass> |
classes() |
Returns an iterator that walks the nested classes defined in this
class.
|
JPackage |
getPackage() |
Gets the nearest package parent.
|
boolean |
isClass() |
Returns true if the container is a class.
|
boolean |
isPackage() |
Returns true if the container is a package.
|
JCodeModel |
owner() |
Get the root code model object.
|
JClassContainer |
parentContainer() |
Parent JClassContainer.
|
boolean isClass()
boolean isPackage()
JDefinedClass _class(int mods, String name) throws JClassAlreadyExistsException
mods
- Modifiers for this class declarationname
- Name of class to be added to this packageJClassAlreadyExistsException
- When the specified class/interface was already created.JDefinedClass _class(String name) throws JClassAlreadyExistsException
JClassAlreadyExistsException
- When the specified class/interface was already created.JDefinedClass _interface(int mods, String name) throws JClassAlreadyExistsException
mods
- Modifiers for this interface declarationname
- Name of interface to be added to this packageJClassAlreadyExistsException
- When the specified class/interface was already created.JDefinedClass _interface(String name) throws JClassAlreadyExistsException
JClassAlreadyExistsException
- When the specified class/interface was already created.JDefinedClass _class(int mods, String name, boolean isInterface) throws JClassAlreadyExistsException
JClassAlreadyExistsException
JDefinedClass _class(int mods, String name, ClassType kind) throws JClassAlreadyExistsException
JClassAlreadyExistsException
Iterator<JDefinedClass> classes()
JClassContainer parentContainer()
JPackage getPackage()
If this.isPackage()
, then return this
.
JCodeModel owner()
JDefinedClass _annotationTypeDeclaration(String name) throws JClassAlreadyExistsException
name
- Name of the annotation Type declaration to be added to this packageJClassAlreadyExistsException
- When the specified class/interface was already created.JDefinedClass _enum(String name) throws JClassAlreadyExistsException
name
- Name of the enum to be added to this packageJClassAlreadyExistsException
- When the specified class/interface was already created.Copyright © 2018 Oracle Corporation. All rights reserved.