use of com.robotoworks.mechanoid.net.netModel.UserType in project mechanoid by robotoworks.
the class JsonWriterStatementGenerator method _genStatementForUserTypeGenericList.
protected CharSequence _genStatementForUserTypeGenericList(final TypedMember member, final GenericListType type, final UserType itemType, final EnumTypeDeclaration decl) {
StringConcatenation _builder = new StringConcatenation();
ImportHelper _imports = this.getImports();
_imports.addImport("java.util.List");
_builder.newLineIfNotEmpty();
ImportHelper _imports_1 = this.getImports();
_imports_1.addImport("java.util.ArrayList");
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("if(");
String _getMethodName = ModelExtensions.toGetMethodName(member);
String _subjectIdentifier = this.getSubjectIdentifier();
String _memberize = ModelExtensions.memberize(_getMethodName, _subjectIdentifier);
_builder.append(_memberize, "");
_builder.append("() != null) {");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
String _writerIdentifier = this.getWriterIdentifier();
_builder.append(_writerIdentifier, "\t");
_builder.append(".name(\"");
String _name = member.getName();
_builder.append(_name, "\t");
_builder.append("\");");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
String _writerIdentifier_1 = this.getWriterIdentifier();
_builder.append(_writerIdentifier_1, "\t");
_builder.append(".beginArray();");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
_builder.append("for(");
Type _type = member.getType();
String _innerSignature = ModelExtensions.innerSignature(_type);
_builder.append(_innerSignature, "\t");
_builder.append(" element : ");
String _getMethodName_1 = ModelExtensions.toGetMethodName(member);
String _subjectIdentifier_1 = this.getSubjectIdentifier();
String _memberize_1 = ModelExtensions.memberize(_getMethodName_1, _subjectIdentifier_1);
_builder.append(_memberize_1, "\t");
_builder.append("()) {");
_builder.newLineIfNotEmpty();
_builder.append("\t\t");
String _writerIdentifier_2 = this.getWriterIdentifier();
_builder.append(_writerIdentifier_2, "\t\t");
_builder.append(".value(element.toString());");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t");
_builder.newLine();
_builder.append("\t");
String _writerIdentifier_3 = this.getWriterIdentifier();
_builder.append(_writerIdentifier_3, "\t");
_builder.append(".endArray();");
_builder.newLineIfNotEmpty();
_builder.append("}");
_builder.newLine();
return _builder;
}
Aggregations