org.mule.devkit.model.code
Interface ClassContainer

All Known Implementing Classes:
GeneratedClass, GeneratedPackage

public interface ClassContainer

The common aspect of a package and a class.


Method Summary
 GeneratedClass _annotationTypeDeclaration(String name)
          Add an annotationType Declaration to this package
 GeneratedClass _class(int mods, String name)
          Add a new class to this package/class.
 GeneratedClass _class(int mods, String name, boolean isInterface)
          Deprecated. use _class(int, String, GeneratedClassType)
 GeneratedClass _class(int mods, String name, GeneratedClassType kind)
          Creates a new class/enum/interface/annotation.
 GeneratedClass _class(String name)
          Add a new public class to this class/package.
 GeneratedClass _enum(String name)
          Add a public enum to this package
 GeneratedClass _interface(int mods, String name)
          Add an interface to this class/package.
 GeneratedClass _interface(String name)
          Adds a public interface to this package.
 Iterator<GeneratedClass> classes()
          Returns an iterator that walks the nested classes defined in this class.
 GeneratedPackage 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.
 CodeModel owner()
          Get the root code model object.
 ClassContainer parentContainer()
          Parent ClassContainer.
 

Method Detail

isClass

boolean isClass()
Returns true if the container is a class.


isPackage

boolean isPackage()
Returns true if the container is a package.


_class

GeneratedClass _class(int mods,
                      String name)
                      throws ClassAlreadyExistsException
Add a new class to this package/class.

Parameters:
mods - Modifiers for this class declaration
name - Name of class to be added to this package
Returns:
Newly generated class
Throws:
ClassAlreadyExistsException - When the specified class/interface was already created.

_class

GeneratedClass _class(String name)
                      throws ClassAlreadyExistsException
Add a new public class to this class/package.

Throws:
ClassAlreadyExistsException - When the specified class/interface was already created.

_interface

GeneratedClass _interface(int mods,
                          String name)
                          throws ClassAlreadyExistsException
Add an interface to this class/package.

Parameters:
mods - Modifiers for this interface declaration
name - Name of interface to be added to this package
Returns:
Newly generated interface
Throws:
ClassAlreadyExistsException - When the specified class/interface was already created.

_interface

GeneratedClass _interface(String name)
                          throws ClassAlreadyExistsException
Adds a public interface to this package.

Throws:
ClassAlreadyExistsException - When the specified class/interface was already created.

_class

GeneratedClass _class(int mods,
                      String name,
                      boolean isInterface)
                      throws ClassAlreadyExistsException
Deprecated. use _class(int, String, GeneratedClassType)

Create a new class or a new interface.

Throws:
ClassAlreadyExistsException

_class

GeneratedClass _class(int mods,
                      String name,
                      GeneratedClassType kind)
                      throws ClassAlreadyExistsException
Creates a new class/enum/interface/annotation.

Throws:
ClassAlreadyExistsException

classes

Iterator<GeneratedClass> classes()
Returns an iterator that walks the nested classes defined in this class.


parentContainer

ClassContainer parentContainer()
Parent ClassContainer.

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.


getPackage

GeneratedPackage getPackage()
Gets the nearest package parent.

If this.isPackage(), then return this.


owner

CodeModel owner()
Get the root code model object.


_annotationTypeDeclaration

GeneratedClass _annotationTypeDeclaration(String name)
                                          throws ClassAlreadyExistsException
Add an annotationType Declaration to this package

Parameters:
name - Name of the annotation Type declaration to be added to this package
Returns:
newly created Annotation Type Declaration
Throws:
ClassAlreadyExistsException - When the specified class/interface was already created.

_enum

GeneratedClass _enum(String name)
                     throws ClassAlreadyExistsException
Add a public enum to this package

Parameters:
name - Name of the enum to be added to this package
Returns:
newly created Enum
Throws:
ClassAlreadyExistsException - When the specified class/interface was already created.


Copyright © 2010–2014 MuleSoft, Inc.. All rights reserved.