public class JClass extends AbstractJClass
Constructor and Description |
---|
JClass(String name)
Creates a new JClass with the given name.
|
JClass(String name,
boolean useOldFieldNaming)
Creates a new JClass with the given name.
|
Modifier and Type | Method and Description |
---|---|
void |
addImport(String className)
Adds the given import to this JStructure.
|
void |
addMember(JMember jMember)
Adds the given JMember to this JStructure.
|
void |
changeLocalName(String localName)
Changes the local name of this class type.
|
JTypeName |
getSuperClass()
Returns the super class that this class extends.
|
String |
getSuperClassQualifiedName()
Returns the qualified name of the super class that this class extends.
|
void |
print(JSourceWriter jsw,
boolean classOnly)
Deprecated.
Please use the Velocity-template based approach instead.
|
void |
setSuperClass(String superClass)
Sets the super Class that this class extends.
|
addConstant, addConstructor, addField, addMethod, addMethod, addMethods, addSourceCode, createConstructor, createConstructor, createInnerClass, getConstant, getConstantCount, getConstants, getConstructor, getConstructors, getContructorsCount, getField, getFieldCount, getFields, getInnerClassCount, getInnerClasses, getMethod, getMethod, getMethodCount, getMethods, getSourceCodeEntries, getSourceCodeEntryCount, getStaticInitializationCode, print, printClassHeaders, printConstantDefinitions, printConstructors, printInnerClasses, printMemberVariables, printMethods, printSourceCodeFragments, printStaticInitializers, removeConstant, removeConstant, removeConstructor, removeField, removeField, removeInnerClass, removeMethod
addAnnotation, addImport, addImport, addImportInternal, addInterface, getAnnotatedElementHelper, getAnnotation, getAnnotations, getFilename, getHeader, getImportCount, getImports, getInterfaceCount, getInterfaces, getJDocComment, getModifiers, getPackageName, hasAnnotations, hasImport, isAnnotationPresent, print, printHeader, printImportDeclarations, printPackageDeclaration, removeAnnotation, removeImport, removeInterface, setHeader, toString
getLocalName, getName, isArray, isPrimitive, setName
public JClass(String name)
name
- The name of the JClass to create.public JClass(String name, boolean useOldFieldNaming)
name
- The name of the JClass to create.useOldFieldNaming
- Whether to use old field naming conventionspublic final void addImport(String className)
addImport
in class JStructure
className
- Name of the class to import.public void addMember(JMember jMember)
addMember
in class JStructure
jMember
- The JMember to add to this JStructure.public final JTypeName getSuperClass()
public final String getSuperClassQualifiedName()
public final void setSuperClass(String superClass)
superClass
- The super Class that this Class extends.public void print(JSourceWriter jsw, boolean classOnly)
print
in class AbstractJClass
jsw
- The JSourceWriter to print to. Must not be null.classOnly
- If true, the file header, package declaration, and
imports are not printed.SourceGenerator.setJClassPrinterType(String)
public void changeLocalName(String localName)
localName
- The new local name to be used.Copyright © 2018. All rights reserved.