Every CodeModel node is always owned by one {@link JCodeModel} objectat any given time (which can be often accesesd by the owner() method.) As such, when you generate Java code, most of the operation works in a top-down fashion. For example, you create a class from {@link JCodeModel}, which gives you a {@link JDefinedClass}. Then you invoke a method on it to generate a new method, which gives you {@link JMethod}, and so on. There are a few exceptions to this, most notably building {@link JExpression}s, but generally you work with CodeModel in a top-down fashion. Because of this design, most of the CodeModel classes aren't directly instanciable.
Most of the time you'd want to populate new type definitions in a {@link JCodeModel}. See {@link #_class(String,ClassType)}.
Every CodeModel node is always owned by one {@link JCodeModel} objectat any given time (which can be often accesesd by the owner() method.) As such, when you generate Java code, most of the operation works in a top-down fashion. For example, you create a class from {@link JCodeModel}, which gives you a {@link JDefinedClass}. Then you invoke a method on it to generate a new method, which gives you {@link JMethod}, and so on. There are a few exceptions to this, most notably building {@link JExpression}s, but generally you work with CodeModel in a top-down fashion. Because of this design, most of the CodeModel classes aren't directly instanciable.
Most of the time you'd want to populate new type definitions in a {@link JCodeModel}. See {@link #_class(String,ClassType)}.
|
|
|
|
|
|