public abstract class JavaGen extends java.lang.Object implements SourceGeneratorI
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INDENT |
Constructor and Description |
---|
JavaGen(java.lang.String classname,
java.lang.String packageName) |
JavaGen(java.lang.String classname,
java.lang.String packageName,
java.lang.String parentClass) |
Modifier and Type | Method and Description |
---|---|
abstract void |
addField(java.lang.String fieldName,
java.lang.String type) |
void |
addField(java.lang.String fieldName,
java.lang.String type,
java.lang.String visibility) |
void |
addField(java.lang.String fieldName,
java.lang.String type,
java.lang.String visibility,
java.lang.String defaultValue) |
java.lang.String |
addImport(java.lang.String classToImport)
adds an import for the given fully qualified class name and returns the simple name of the class
|
void |
addJavadocLine(java.lang.String line) |
JavaMethodGen |
addMethod(java.lang.String modifiers,
java.lang.String methodName,
java.util.Map<java.lang.String,java.lang.String> args) |
JavaMethodGen |
addMethod(java.lang.String modifiers,
java.lang.String returnType,
java.lang.String methodName,
java.util.Map<java.lang.String,java.lang.String> args) |
JavaMethodGen |
addMethod(java.lang.String modifiers,
java.lang.String returnType,
java.lang.String methodName,
java.util.Map<java.lang.String,java.lang.String> args,
java.util.Set<java.lang.String> annotations) |
JavaMethodGen |
addMethod(java.lang.String modifiers,
java.lang.String returnType,
java.lang.String methodName,
java.lang.String paramName,
java.lang.String paramType) |
AttributeTypeCodeGen<JavaMethodGen,JavaClassGen,?> |
getAttributeTypeCodeGen(CBOAttributeTypeI attrType,
java.lang.String attrName) |
java.lang.String |
getName() |
java.lang.String |
getPackage() |
java.lang.String |
getSource()
Returns java class code as a string
|
boolean |
isFieldDeclared(java.lang.String fieldName) |
boolean |
isMethodDeclared(java.lang.String fieldName) |
static boolean |
isValidName(java.lang.String className) |
void |
setClassComment(java.lang.String comment) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSimpleName, getSimpleNames
public static final java.lang.String INDENT
public JavaGen(java.lang.String classname, java.lang.String packageName)
public JavaGen(java.lang.String classname, java.lang.String packageName, java.lang.String parentClass)
public AttributeTypeCodeGen<JavaMethodGen,JavaClassGen,?> getAttributeTypeCodeGen(CBOAttributeTypeI attrType, java.lang.String attrName)
getAttributeTypeCodeGen
in interface SourceGeneratorI
public java.lang.String getName()
public java.lang.String getPackage()
getPackage
in interface SourceGeneratorI
public java.lang.String addImport(java.lang.String classToImport)
SourceGeneratorI
addImport
in interface SourceGeneratorI
classToImport
- fully qualified name of a classpublic void setClassComment(java.lang.String comment)
public void addJavadocLine(java.lang.String line)
public abstract void addField(java.lang.String fieldName, java.lang.String type)
public void addField(java.lang.String fieldName, java.lang.String type, java.lang.String visibility)
public void addField(java.lang.String fieldName, java.lang.String type, java.lang.String visibility, java.lang.String defaultValue)
public boolean isFieldDeclared(java.lang.String fieldName)
public JavaMethodGen addMethod(java.lang.String modifiers, java.lang.String methodName, java.util.Map<java.lang.String,java.lang.String> args)
public JavaMethodGen addMethod(java.lang.String modifiers, java.lang.String returnType, java.lang.String methodName, java.util.Map<java.lang.String,java.lang.String> args)
public JavaMethodGen addMethod(java.lang.String modifiers, java.lang.String returnType, java.lang.String methodName, java.util.Map<java.lang.String,java.lang.String> args, java.util.Set<java.lang.String> annotations)
public JavaMethodGen addMethod(java.lang.String modifiers, java.lang.String returnType, java.lang.String methodName, java.lang.String paramName, java.lang.String paramType)
public boolean isMethodDeclared(java.lang.String fieldName)
public java.lang.String getSource()
getSource
in interface SourceGeneratorI
public static boolean isValidName(java.lang.String className)
className
- Copyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.