public class ModelConstructorWriter extends MethodWriter
ABSTRACT, FINAL, STATIC, SYNCHRONIZED| Constructor and Description |
|---|
ModelConstructorWriter(java.lang.String className)
Creates a public model constructor with sorted parameters.
|
ModelConstructorWriter(Visibility visibility,
java.lang.String className,
boolean sortedArguments)
Creates a model constructor with the given
Visibility, the class name, the type and if the constructor
parameters should be sorted alphabetically or not. |
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(java.lang.String type,
YAttributeDescriptor desc,
boolean mandatory) |
protected java.lang.String |
assembleSignature() |
int |
getParamaterCount() |
void |
write(JavaFile file) |
protected void |
writeContent(JavaFile file) |
addAnnotation, addComment, addParameter, addThrownException, analyzeAndStripReturnType, assembleThrowsClause, extractClassNames, getAnnotations, getContent, getJavadoc, getModifiers, getName, getParameterType, getRequiredImports, getReturnType, getSignature, getThrownExceptions, getVisibility, isAbstract, isConstructor, modifiersToString, setAbstract, setConstructor, setContent, setContentPlain, setJavadoc, setModifiers, setReturnType, setVisibility, stripPackageName, writeTextToFileaddRequiredImportpublic ModelConstructorWriter(java.lang.String className)
className - the class namepublic ModelConstructorWriter(Visibility visibility, java.lang.String className, boolean sortedArguments)
Visibility, the class name, the type and if the constructor
parameters should be sorted alphabetically or not.visibility - should be public or protectedclassName - the class namesortedArguments - if false the parameters are in the order which they where added.protected java.lang.String assembleSignature()
assembleSignature in class MethodWriterpublic void write(JavaFile file)
write in interface CodeWriterwrite in class MethodWriterprotected void writeContent(JavaFile file)
writeContent in class MethodWriterpublic void addParameter(java.lang.String type,
YAttributeDescriptor desc,
boolean mandatory)
public int getParamaterCount()
Copyright © 2018 SAP SE. All Rights Reserved.