public class JavaInterfaceGen extends JavaGen
This class extends JavaGen to provide functionality for generating Java code representing interfaces. It supports specifying the interface name, package, and parent interfaces to inherit from.
Constructor and Description |
---|
JavaInterfaceGen(java.lang.String classname,
java.lang.String packageName)
Constructs a JavaInterfaceGen with the specified class name and package.
|
JavaInterfaceGen(java.lang.String classname,
java.lang.String packageName,
java.util.Set<java.lang.String> parentInterfaces)
Constructs a JavaInterfaceGen with the specified class name, package, and parent interfaces.
|
Modifier and Type | Method and Description |
---|---|
void |
addField(java.lang.String fieldName,
java.lang.String type) |
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) |
void |
addMethodDeclaration(java.lang.String returnType,
java.lang.String methodName,
java.lang.String paramName,
java.lang.String paramType) |
addField, addField, addImport, addJavadocLine, addMethod, addMethod, getAttributeTypeCodeGen, getName, getPackage, getSource, isFieldDeclared, isMethodDeclared, isValidName, setClassComment
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSimpleName, getSimpleNames
public JavaInterfaceGen(java.lang.String classname, java.lang.String packageName)
classname
- The name of the interface to generate.packageName
- The package for the generated interface.public JavaInterfaceGen(java.lang.String classname, java.lang.String packageName, java.util.Set<java.lang.String> parentInterfaces)
classname
- The name of the interface to generate.packageName
- The package for the generated interface.parentInterfaces
- The set of parent interfaces to inherit from.public void addField(java.lang.String fieldName, java.lang.String type)
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 void addMethodDeclaration(java.lang.String returnType, java.lang.String methodName, java.lang.String paramName, java.lang.String paramType)
public JavaMethodGen addMethod(java.lang.String modifiers, java.lang.String returnType, java.lang.String methodName, java.lang.String paramName, java.lang.String paramType)
Copyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.