Package deltix.util.jcg.scg
Class ClassImpl
- java.lang.Object
-
- deltix.util.jcg.scg.ClassImpl
-
- All Implemented Interfaces:
JAnnotationContainer
,JClass
,JMember
,JType
,JVariableContainer
,JTypeImpl
- Direct Known Subclasses:
JEnumImpl
public abstract class ClassImpl extends java.lang.Object implements JClass, JTypeImpl
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<JAnnotation>
annotations
protected JContextImpl
context
protected java.lang.String
fullName
protected java.util.List<java.lang.String>
interfaceNames
protected java.lang.String
packageName
protected java.lang.String
parentName
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addAnnotation(JAnnotation annotation)
void
addComment(java.lang.String text)
JConstructor
addConstructor(int modifiers)
void
addImplementedInterface(JClass cls)
void
addImplementedInterface(java.lang.Class<?> cls)
JMethod
addMethod(int modifiers, JType type, java.lang.String name)
JMethod
addMethod(int modifiers, java.lang.Class<?> type, java.lang.String name)
JMemberVariable
addProperty(int modifiers, java.lang.Class<?> type, java.lang.String name)
JInitMemberVariable
addVar(int modifiers, JType type, JType[] typeArgs, java.lang.String name, JExpr initValue, boolean nullable)
JInitMemberVariable
addVar(int modifiers, JType type, java.lang.String name)
JInitMemberVariable
addVar(int modifiers, JType type, java.lang.String name, JExpr initValue)
JInitMemberVariable
addVar(int modifiers, JType type, java.lang.String name, JExpr initValue, boolean nullable)
JInitVariable
addVar(int modifiers, java.lang.Class<?> type, java.lang.Class<?>[] typeArgs, java.lang.String name, JExpr initValue)
JInitMemberVariable
addVar(int modifiers, java.lang.Class<?> type, java.lang.String name)
JInitMemberVariable
addVar(int modifiers, java.lang.Class<?> type, java.lang.String name, JExpr initValue)
JClass
containerClass()
java.lang.String
fullName()
JConstructor
getConstructor()
JMethod
getMethod(java.lang.String name)
JMemberVariable
getVar(java.lang.String name)
java.util.List<JMemberVariable>
getVars()
JMemberVariable
inheritedVar(java.lang.String name)
JClass
innerClass(int modifiers, java.lang.String simpleName)
JClass
innerClass(int modifiers, java.lang.String simpleName, JClass parent)
JClass
innerClass(int modifiers, java.lang.String simpleName, java.lang.Class<?> parent)
int
modifiers()
java.lang.String
name()
JExpr
newExpr(JExpr... args)
java.lang.String
packageName()
Returns the package name of this class, or null if top-level package.protected void
printAnnotations(SourceCodePrinter out)
void
printDeclaration(SourceCodePrinter out)
JMemberVariable
thisVar()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface deltix.util.jcg.JClass
callSuperMethod
-
Methods inherited from interface deltix.util.jcg.JMember
containerClass, modifiers, name
-
-
-
-
Field Detail
-
fullName
protected final java.lang.String fullName
-
parentName
protected final java.lang.String parentName
-
packageName
protected final java.lang.String packageName
-
interfaceNames
protected final java.util.List<java.lang.String> interfaceNames
-
annotations
protected final java.util.List<JAnnotation> annotations
-
context
protected final JContextImpl context
-
-
Method Detail
-
fullName
public java.lang.String fullName()
-
packageName
public java.lang.String packageName()
Description copied from interface:JClass
Returns the package name of this class, or null if top-level package.- Specified by:
packageName
in interfaceJClass
-
addAnnotation
public void addAnnotation(JAnnotation annotation)
- Specified by:
addAnnotation
in interfaceJAnnotationContainer
-
innerClass
public JClass innerClass(int modifiers, java.lang.String simpleName)
- Specified by:
innerClass
in interfaceJClass
-
innerClass
public final JClass innerClass(int modifiers, java.lang.String simpleName, java.lang.Class<?> parent)
- Specified by:
innerClass
in interfaceJClass
-
innerClass
public final JClass innerClass(int modifiers, java.lang.String simpleName, JClass parent)
- Specified by:
innerClass
in interfaceJClass
-
addImplementedInterface
public void addImplementedInterface(java.lang.Class<?> cls)
- Specified by:
addImplementedInterface
in interfaceJClass
-
addImplementedInterface
public void addImplementedInterface(JClass cls)
- Specified by:
addImplementedInterface
in interfaceJClass
-
addComment
public void addComment(java.lang.String text)
- Specified by:
addComment
in interfaceJVariableContainer
-
addMethod
public final JMethod addMethod(int modifiers, java.lang.Class<?> type, java.lang.String name)
-
addVar
public JInitMemberVariable addVar(int modifiers, java.lang.Class<?> type, java.lang.String name)
- Specified by:
addVar
in interfaceJClass
- Specified by:
addVar
in interfaceJVariableContainer
-
addVar
public JInitMemberVariable addVar(int modifiers, java.lang.Class<?> type, java.lang.String name, JExpr initValue)
- Specified by:
addVar
in interfaceJClass
- Specified by:
addVar
in interfaceJVariableContainer
-
addVar
public JInitMemberVariable addVar(int modifiers, JType type, java.lang.String name)
- Specified by:
addVar
in interfaceJClass
- Specified by:
addVar
in interfaceJVariableContainer
-
addVar
public JInitMemberVariable addVar(int modifiers, JType type, java.lang.String name, JExpr initValue)
- Specified by:
addVar
in interfaceJClass
- Specified by:
addVar
in interfaceJVariableContainer
-
addVar
public JInitVariable addVar(int modifiers, java.lang.Class<?> type, java.lang.Class<?>[] typeArgs, java.lang.String name, JExpr initValue)
- Specified by:
addVar
in interfaceJVariableContainer
-
addVar
public JInitMemberVariable addVar(int modifiers, JType type, java.lang.String name, JExpr initValue, boolean nullable)
-
addVar
public JInitMemberVariable addVar(int modifiers, JType type, JType[] typeArgs, java.lang.String name, JExpr initValue, boolean nullable)
-
addProperty
public JMemberVariable addProperty(int modifiers, java.lang.Class<?> type, java.lang.String name)
- Specified by:
addProperty
in interfaceJClass
-
inheritedVar
public JMemberVariable inheritedVar(java.lang.String name)
- Specified by:
inheritedVar
in interfaceJClass
-
thisVar
public JMemberVariable thisVar()
-
addConstructor
public final JConstructor addConstructor(int modifiers)
- Specified by:
addConstructor
in interfaceJClass
-
getConstructor
public JConstructor getConstructor()
-
printAnnotations
protected void printAnnotations(SourceCodePrinter out) throws java.io.IOException
- Throws:
java.io.IOException
-
getMethod
public JMethod getMethod(java.lang.String name)
-
getVars
public java.util.List<JMemberVariable> getVars()
-
getVar
public JMemberVariable getVar(java.lang.String name)
-
containerClass
public final JClass containerClass()
- Specified by:
containerClass
in interfaceJMember
-
printDeclaration
public abstract void printDeclaration(SourceCodePrinter out) throws java.io.IOException
- Throws:
java.io.IOException
-
-