public abstract class AbstractJClassContainer<CLASSTYPE extends AbstractJClassContainer<CLASSTYPE>> extends AbstractJClass implements IJClassContainer<CLASSTYPE>
AbstractJClass.| Modifier and Type | Field and Description |
|---|---|
protected Map<String,CLASSTYPE> |
m_aClasses
Nested classes as a map from name to JDefinedClass.
|
EMPTY_ARRAY| Modifier | Constructor and Description |
|---|---|
protected |
AbstractJClassContainer(JCodeModel aOwner,
IJClassContainer<?> aOuter,
EClassType eClassType,
String sName)
JClass constructor
|
| Modifier and Type | Method and Description |
|---|---|
CLASSTYPE |
_annotationTypeDeclaration(int nMods,
String sName)
Add an annotationType Declaration to this package
|
CLASSTYPE |
_annotationTypeDeclaration(String sName)
Add an annotationType Declaration to this package
|
CLASSTYPE |
_class(int nMods,
String sName)
Add a new class to this package/class.
|
CLASSTYPE |
_class(int nMods,
String sName,
EClassType eClassType)
Creates a new class/enum/interface/annotation.
|
CLASSTYPE |
_class(String sName)
Add a new public class to this class/package.
|
CLASSTYPE |
_enum(int nMods,
String sName)
Add a enum to this package
|
CLASSTYPE |
_enum(String sName)
Add a public enum to this package
|
CLASSTYPE |
_interface(int nMods,
String sName)
Add an interface to this class/package.
|
CLASSTYPE |
_interface(String sName)
Adds a public interface to this package.
|
Collection<CLASSTYPE> |
classes()
Returns an iterator that walks the nested classes defined in this class.
|
protected abstract CLASSTYPE |
createInnerClass(int nMods,
EClassType eClassType,
String sName) |
String |
fullName()
Gets the fully qualified name of this class.
|
EClassType |
getClassType() |
IJClassContainer<?> |
getOuter() |
JPackage |
getPackage() |
boolean |
isAnnotationTypeDeclaration()
This method indicates if the interface is an annotationTypeDeclaration
|
boolean |
isAnonymous() |
boolean |
isClass() |
boolean |
isInterface() |
boolean |
isPackage() |
String |
name()
Class name accessor.
|
AbstractJClass |
outer() |
IJClassContainer<?> |
parentContainer() |
protected CLASSTYPE |
thisAsT() |
_extends, _implements, _package, array, boxify, dotclass, erasure, generate, getBaseClass, getBaseClass, getPrimitiveType, getTypeParameters, isAbstract, isParameterized, narrow, narrow, narrow, narrow, narrow, narrow, owner, staticInvoke, staticInvoke, staticRef, staticRef, substituteParams, toString, typeParams, unboxify, wildcard, wildcard, wildcardSuperbinaryName, elementType, isArray, isAssignableFrom, isAssignableFrom, isError, isPrimitive, isReference, parseprotected Map<String,CLASSTYPE extends AbstractJClassContainer<CLASSTYPE>> m_aClasses
JCodeModel.isCaseSensitiveFileSystem) to avoid conflicts. Lazily
created to save footprint._getClasses()protected AbstractJClassContainer(@Nonnull JCodeModel aOwner, @Nullable IJClassContainer<?> aOuter, @Nonnull EClassType eClassType, @Nullable String sName)
aOwner - Owning code modelaOuter - Optional outer class containereClassType - Class type to usesName - Name of this class@Nullable public final IJClassContainer<?> getOuter()
@Nullable public final AbstractJClass outer()
outer in class AbstractJClass@Nonnull public final EClassType getClassType()
public final boolean isInterface()
isInterface in class AbstractJClasstrue if this object represents an interface.public final boolean isAnnotationTypeDeclaration()
true if this an annotation type declaration@Nullable public String name()
java.util.List, this method returns
"List""name in class AbstractJClass@Nullable public String fullName()
fullName in class AbstractJTypenull for unnamed classes.public final boolean isAnonymous()
true if this is an anonymous class.public final boolean isClass()
isClass in interface IJClassContainer<CLASSTYPE extends AbstractJClassContainer<CLASSTYPE>>true if the container is a class, false
if it is a packageIJClassContainer.isPackage()public final boolean isPackage()
isPackage in interface IJClassContainer<CLASSTYPE extends AbstractJClassContainer<CLASSTYPE>>true if the container is a package, false
if it is a class.IJClassContainer.isClass()@Nonnull public final IJClassContainer<?> parentContainer()
parentContainer in interface IJClassContainer<CLASSTYPE extends AbstractJClassContainer<CLASSTYPE>>IJClassContainer. 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 JPackage to which it belongs. If this is an inner
class, this method returns the outer class.public final JPackage getPackage()
getPackage in interface IJClassContainer<CLASSTYPE extends AbstractJClassContainer<CLASSTYPE>>@Nonnull protected abstract CLASSTYPE createInnerClass(int nMods, @Nonnull EClassType eClassType, @Nonnull String sName)
@Nonnull public final CLASSTYPE _class(int nMods, @Nonnull String sName, @Nonnull EClassType eClassType) throws JClassAlreadyExistsException
IJClassContainer_class in interface IJClassContainer<CLASSTYPE extends AbstractJClassContainer<CLASSTYPE>>nMods - Modifiers for this ...sName - Name of ... to be added to this package.eClassType - The type of class to create. May not be null.JClassAlreadyExistsException - If another class/interface/... with the same name already exists@Nonnull public final CLASSTYPE _class(@Nonnull String sName) throws JClassAlreadyExistsException
IJClassContainer_class in interface IJClassContainer<CLASSTYPE extends AbstractJClassContainer<CLASSTYPE>>sName - Name of class to be added to this packageJClassAlreadyExistsException - If another class/interface/... with the same name already exists@Nonnull public final CLASSTYPE _class(int nMods, @Nonnull String sName) throws JClassAlreadyExistsException
IJClassContainer_class in interface IJClassContainer<CLASSTYPE extends AbstractJClassContainer<CLASSTYPE>>nMods - Modifiers for this class declarationsName - Name of class to be added to this packageJClassAlreadyExistsException - If another class/interface/... with the same name already exists@Nonnull public final CLASSTYPE _interface(@Nonnull String sName) throws JClassAlreadyExistsException
IJClassContainer_interface in interface IJClassContainer<CLASSTYPE extends AbstractJClassContainer<CLASSTYPE>>sName - Name of interface to be added to this packageJClassAlreadyExistsException - If another class/interface/... with the same name already exists@Nonnull public final CLASSTYPE _interface(int nMods, @Nonnull String sName) throws JClassAlreadyExistsException
IJClassContainer_interface in interface IJClassContainer<CLASSTYPE extends AbstractJClassContainer<CLASSTYPE>>nMods - Modifiers for this interface declarationsName - Name of interface to be added to this packageJClassAlreadyExistsException - If another class/interface/... with the same name already exists@Nonnull public final CLASSTYPE _annotationTypeDeclaration(@Nonnull String sName) throws JClassAlreadyExistsException
IJClassContainer_annotationTypeDeclaration in interface IJClassContainer<CLASSTYPE extends AbstractJClassContainer<CLASSTYPE>>sName - Name of the annotation Type declaration to be added to this packageJClassAlreadyExistsException - If another class/interface/... with the same name already exists@Nonnull public final CLASSTYPE _annotationTypeDeclaration(int nMods, @Nonnull String sName) throws JClassAlreadyExistsException
IJClassContainer_annotationTypeDeclaration in interface IJClassContainer<CLASSTYPE extends AbstractJClassContainer<CLASSTYPE>>nMods - Modifiers for this annotation Type declarationsName - Name of the annotation Type declaration to be added to this packageJClassAlreadyExistsException - If another class/interface/... with the same name already exists@Nonnull public final CLASSTYPE _enum(@Nonnull String sName) throws JClassAlreadyExistsException
IJClassContainer_enum in interface IJClassContainer<CLASSTYPE extends AbstractJClassContainer<CLASSTYPE>>sName - Name of the enum to be added to this packageJClassAlreadyExistsException - If another class/interface/... with the same name already exists@Nonnull public final CLASSTYPE _enum(int nMods, @Nonnull String sName) throws JClassAlreadyExistsException
IJClassContainer_enum in interface IJClassContainer<CLASSTYPE extends AbstractJClassContainer<CLASSTYPE>>nMods - Modifiers for this enum declarationsName - Name of the enum to be added to this packageJClassAlreadyExistsException - If another class/interface/... with the same name already exists@Nonnull public final Collection<CLASSTYPE> classes()
classes in interface IJClassContainer<CLASSTYPE extends AbstractJClassContainer<CLASSTYPE>>null.Copyright © 2013–2015 Philip Helger. All rights reserved.