Class ModelConstructorWriter
- java.lang.Object
-
- de.hybris.bootstrap.codegenerator.AbstractImportProvider
-
- de.hybris.bootstrap.codegenerator.MethodWriter
-
- de.hybris.bootstrap.codegenerator.model.ModelConstructorWriter
-
- All Implemented Interfaces:
CodeWriter
public class ModelConstructorWriter extends MethodWriter
The model constructor class. Contains the constructor parameters (sorted, non-sorted), api documentation and annotations.
-
-
Field Summary
-
Fields inherited from class de.hybris.bootstrap.codegenerator.MethodWriter
ABSTRACT, FINAL, STATIC, SYNCHRONIZED
-
-
Constructor Summary
Constructors Constructor Description ModelConstructorWriter(Visibility visibility, java.lang.String className, boolean sortedArguments)Creates a model constructor with the givenVisibility, the class name, the type and if the constructor parameters should be sorted alphabetically or not.ModelConstructorWriter(java.lang.String className)Creates a public model constructor with sorted parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddParameter(java.lang.String type, YAttributeDescriptor desc, boolean mandatory)protected java.lang.StringassembleSignature()intgetParamaterCount()voidwrite(JavaFile file)protected voidwriteContent(JavaFile file)-
Methods inherited from class de.hybris.bootstrap.codegenerator.MethodWriter
addAnnotation, addComment, addDeprecatedAnnotation, 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, writeTextToFile
-
Methods inherited from class de.hybris.bootstrap.codegenerator.AbstractImportProvider
addRequiredImport
-
-
-
-
Constructor Detail
-
ModelConstructorWriter
public ModelConstructorWriter(java.lang.String className)
Creates a public model constructor with sorted parameters.- Parameters:
className- the class name
-
ModelConstructorWriter
public ModelConstructorWriter(Visibility visibility, java.lang.String className, boolean sortedArguments)
Creates a model constructor with the givenVisibility, the class name, the type and if the constructor parameters should be sorted alphabetically or not.- Parameters:
visibility- should be public or protectedclassName- the class namesortedArguments- if false the parameters are in the order which they where added.
-
-
Method Detail
-
assembleSignature
protected java.lang.String assembleSignature()
- Overrides:
assembleSignaturein classMethodWriter
-
write
public void write(JavaFile file)
- Specified by:
writein interfaceCodeWriter- Overrides:
writein classMethodWriter
-
writeContent
protected void writeContent(JavaFile file)
- Overrides:
writeContentin classMethodWriter
-
addParameter
public void addParameter(java.lang.String type, YAttributeDescriptor desc, boolean mandatory)
-
getParamaterCount
public int getParamaterCount()
-
-