예제 #1
0
 protected CharSequence _generateBaseAccessor(final TypedMember member) {
   StringConcatenation _builder = new StringConcatenation();
   {
     Type _type = member.getType();
     if ((_type instanceof GenericListType)) {
       this.imports.addImport("java.util.List");
     }
   }
   _builder.newLineIfNotEmpty();
   _builder.append("public ");
   Type _type_1 = member.getType();
   String _signature = ModelExtensions.signature(_type_1);
   _builder.append(_signature, "");
   _builder.append(" ");
   String _getMethodName = ModelExtensions.toGetMethodName(member);
   _builder.append(_getMethodName, "");
   _builder.append("(){");
   _builder.newLineIfNotEmpty();
   _builder.append("\t");
   _builder.append("return base.");
   String _getMethodName_1 = ModelExtensions.toGetMethodName(member);
   _builder.append(_getMethodName_1, "\t");
   _builder.append("();");
   _builder.newLineIfNotEmpty();
   _builder.append("}");
   _builder.newLine();
   _builder.append("public void ");
   String _setMethodName = ModelExtensions.toSetMethodName(member);
   _builder.append(_setMethodName, "");
   _builder.append("(");
   Type _type_2 = member.getType();
   String _signature_1 = ModelExtensions.signature(_type_2);
   _builder.append(_signature_1, "");
   _builder.append(" value){");
   _builder.newLineIfNotEmpty();
   _builder.append("\t");
   _builder.append("base.");
   String _setMethodName_1 = ModelExtensions.toSetMethodName(member);
   _builder.append(_setMethodName_1, "\t");
   _builder.append("(value);");
   _builder.newLineIfNotEmpty();
   _builder.append("}");
   _builder.newLine();
   return _builder;
 }
예제 #2
0
 protected CharSequence _generateGetter(final TypedMember member) {
   StringConcatenation _builder = new StringConcatenation();
   _builder.append("public ");
   Type _type = member.getType();
   String _signature = ModelExtensions.signature(_type);
   _builder.append(_signature, "");
   _builder.append(" ");
   String _getMethodName = ModelExtensions.toGetMethodName(member);
   _builder.append(_getMethodName, "");
   _builder.append("(){");
   _builder.newLineIfNotEmpty();
   _builder.append("\t");
   _builder.append("return this.");
   String _identifier = ModelExtensions.toIdentifier(member);
   _builder.append(_identifier, "\t");
   _builder.append(";");
   _builder.newLineIfNotEmpty();
   _builder.append("}");
   _builder.newLine();
   _builder.append("public void ");
   String _setMethodName = ModelExtensions.toSetMethodName(member);
   _builder.append(_setMethodName, "");
   _builder.append("(");
   Type _type_1 = member.getType();
   String _signature_1 = ModelExtensions.signature(_type_1);
   _builder.append(_signature_1, "");
   _builder.append(" value){");
   _builder.newLineIfNotEmpty();
   _builder.append("\t");
   _builder.append("this.");
   String _identifier_1 = ModelExtensions.toIdentifier(member);
   _builder.append(_identifier_1, "\t");
   _builder.append(" = value;");
   _builder.newLineIfNotEmpty();
   _builder.append("}");
   _builder.newLine();
   return _builder;
 }