Writes a method describing the getter for the given key, along with any
other code necessary to support it.  Produces a list of helper methods that
still need to be written.
336217
void writeBindingGetter(Key<?> key, Binding binding, GinScope scope,
      List<InjectorMethod> helperMethodsOutput) {
    Context bindingContext = binding.getContext();

    SourceSnippetBuilder getterBuilder = new SourceSnippetBuilder();
    SourceSnippet creationStatements;
    String getter = nameGenerator.getGetterMethodName(key);

    String typeName;
    try {
      typeName = ReflectUtil.getSourceName(key.getTypeLiteral());

      creationStatements = binding.getCreationStatements(nameGenerator, helperMethodsOutput);
    } catch (NoSourceNameException e) {
      errorManager.logError("Error trying to write getter for [%s] -> [%s];"
          + " binding declaration: %s", e, key, binding, bindingContext);
      return;
    }

    // Name of the field that we might need.
    String field = nameGenerator.getSingletonFieldName(key);

    switch (scope) {
      case EAGER_SINGLETON:
        initializeEagerSingletonsBody.append("// Eager singleton bound at:\n");
        appendBindingContextCommentToMethod(bindingContext, initializeEagerSingletonsBody);
        initializeEagerSingletonsBody.append(getter).append("();\n");
        // !break
        //CHECKSTYLE_OFF
      case SINGLETON:
        //CHECKSTYLE_OFF
        writer.println("private " + typeName + " " + field + " = null;");
        writer.println();
        getterBuilder.append(String.format("\nif (%s == null) {\n", field))
            .append(creationStatements).append("\n")
            .append(String.format("    %s = result;\n", field))
            .append("}\n")
            .append(String.format("return %s;\n", field));
        break;

      case NO_SCOPE:
        sourceWriteUtil.writeBindingContextJavadoc(writer, bindingContext, key);

        getterBuilder.append(creationStatements).append("\n").append("return result;\n");
        break;

      default:
        throw new IllegalStateException();
    }

    outputMethod(SourceSnippets.asMethod(false, String.format("public %s %s()", typeName, getter),
        fragmentPackageName.toString(), getterBuilder.build()));
  }
996341
def _generate_route_keys(self, methods, path):
        
        for method in methods:
            yield self._route_key(method, path)
987301
def write_metadata(self, key, values):
        
        values = Series(values)
        self.parent.put(self._get_metadata_path(key), values, format='table',
                        encoding=self.encoding, errors=self.errors,
                        nan_rep=self.nan_rep)
330979
void writeObjectKeyValue(String key, String value) throws IOException {
        writeObjectKey(key);
        writeString(value);
    }
819521
private void writeMethod(Definition def, Writer out, int indent) throws IOException
   {
      if (def.getMcfDefs().get(getNumOfMcf()).isDefineMethodInConnection())
      {
         if (def.getMcfDefs().get(getNumOfMcf()).getMethods().size() > 0)
         {
            for (MethodForConnection method : def.getMcfDefs().get(getNumOfMcf()).getMethods())
            {
               writeMethodSignature(out, indent, method);
               writeLeftCurlyBracket(out, indent);
               writeIndent(out, indent + 1);

               if (!method.getReturnType().equals("void"))
               {
                  out.write("return ");
               }
               out.write("mc." + method.getMethodName() + "(");
               int paramSize = method.getParams().size();
               for (int i = 0; i < paramSize; i++)
               {
                  MethodParam param = method.getParams().get(i);
                  out.write(param.getName());
                  if (i + 1 < paramSize)
                     out.write(", ");
               }
               out.write(");");

               writeRightCurlyBracket(out, indent);
               writeEol(out);
            }
         }
      }
      else
      {
         writeSimpleMethodSignature(out, indent, " * Call me", "public void callMe()");
         writeLeftCurlyBracket(out, indent);
         writeWithIndent(out, indent + 1, "if (mc != null)\n");
         writeWithIndent(out, indent + 2, "mc.callMe();");
         writeRightCurlyBracket(out, indent);
      }

      writeEol(out);
      writeSimpleMethodSignature(out, indent, " * Close", "public void close()");
      writeLeftCurlyBracket(out, indent);
      writeWithIndent(out, indent + 1, "if (mc != null)\n");
      writeLeftCurlyBracket(out, indent + 1);
      writeWithIndent(out, indent + 2, "mc.closeHandle(this);\n");
      writeIndent(out, indent + 2);
      out.write("mc = null;");
      writeRightCurlyBracket(out, indent + 1);
      writeRightCurlyBracket(out, indent);

      writeEol(out);
      writeWithIndent(out, indent, "/**\n");
      writeWithIndent(out, indent, " * Set ManagedConnection\n");
      writeWithIndent(out, indent, " */\n");
      writeWithIndent(out, indent,
            "void setManagedConnection(" + def.getMcfDefs().get(getNumOfMcf()).getMcClass() + " mc)");
      writeLeftCurlyBracket(out, indent);
      writeWithIndent(out, indent + 1, "this.mc = mc;");
      writeRightCurlyBracket(out, indent);
   }
179604
def write(self, *args):
        """"""
        ConfigParser.write(self, *args)
        if self.keyring_available:
            for key, thing in self._unsaved.items():
                action = thing[0]
                value = thing[1]
                if action == 'set':
                    keyring.set_password(self.keyring_name, key, value)
                elif action == 'delete':
                    try:
                        keyring.delete_password(self.keyring_name, key)
                    except:
                        pass
        self._unsaved = {}
554464
private void writeGetter(final JavaClassSource javaClass, final Property propDef) {
        if (propDef.needGetter()) {
            if (!javaClass.hasMethodSignature(propDef.name())) {

                final StringBuilder javadoc = new StringBuilder();
                javadoc
                       .append("@return the sourcePath\n");

                String body = "";

                if (propDef.isList()) {

                    javaClass.addImport("java.util.stream.Collectors");
                    javaClass.addImport("java.util.ArrayList");

                    body = Templates.use(TemplateName.Getter_List, propDef);

                } else if (propDef.isMap()) {

                    javaClass.addImport("java.util.stream.Collectors");
                    javaClass.addImport("java.util.HashMap");

                    body = Templates.use(TemplateName.Getter_Map, propDef);

                } else {

                    body = Templates.use(TemplateName.Getter, propDef);

                }

                final MethodSource<?> method = javaClass.addMethod()
                                                        .setName(propDef.name())
                                                        .setPublic()
                                                        .setBody(body)
                                                        .setReturnType(propDef.type().qualifiedName());
                method.getJavaDoc().setFullText(javadoc.toString());

            } else {
                // javaClass.getMethod(propDef.getName()).setBody(javaClass.getMethod(propDef.getName()).getBody()
                // + body.toString());
            }
        }
    }
1277579
private void writeKeyDefinition(final Map<String, KeyDef> keydefs) {
        try {
            KeyDef.writeKeydef(new File(job.tempDir, KEYDEF_LIST_FILE), keydefs.values());
        } catch (final DITAOTException e) {
            logger.error("Failed to write key definition file: " + e.getMessage(), e);
        }
    }
777315
function iterateKeys() {
      var obj = getKeyObject(db, j);
      if(obj === null) return onKeysComplete();
      encoder.write(obj, function onWrite() {
        j++;
        setImmediate(iterateKeys);
      });
    }
181274
public void writeBindingContextJavadoc(SourceWriter writer, Context bindingContext,
      Key<?> key) {
    writeBindingContextJavadoc(writer, bindingContext,
        "Binding for " + key.getTypeLiteral() + " declared at:");
  }
632491
protected JsonWriter property(String key, Iterator<?> iterator) throws IOException {
      return property(key, Collect.asIterable(iterator));
   }
1095283
def method_missing(key_name, *args)
      key_name_str = key_name.to_s()
      if key_name_str =~ /=$/ then
        self[key_name_str.chop()] = args[0]
      else
        return self[key_name_str]
      end
    end
567248
function (keys) {
    var Parent = this.constructor;
    var opts = lazy.clone(this.options);
    var res = new Parent(opts);

    lazy.omit(this, keys, function (val, key) {
      res[key] = lazy.clone(val);
    });
    return res;
  }
280914
def instance_writers
      _attrs.keys.map { |m| "#{m}=".to_sym }.select { |m| method_defined?(m) }
    end
823174
Method getSetter(Method getter) {
        synchronized (setterCache) {
            if ( !setterCache.containsKey(getter) ) {
                String attributeName = null;
                if ( getter.getName().startsWith("get") ) {
                    attributeName = getter.getName().substring("get".length());
                } else if ( getter.getName().startsWith("is") ) {
                    attributeName = getter.getName().substring("is".length());
                } else {
                    // should be impossible to reach this exception
                    throw new RuntimeException("Getter method must start with 'is' or 'get'");
                }
                String setterName = "set" + attributeName;
                Method setter = null;
                try {
                    setter = getter.getDeclaringClass().getMethod(setterName, getter.getReturnType());
                } catch ( NoSuchMethodException e ) {
                    throw new DynamoDBMappingException("Expected a public, one-argument method called " + setterName
                            + " on class " + getter.getDeclaringClass(), e);
                } catch ( SecurityException e ) {
                    throw new DynamoDBMappingException("No access to public, one-argument method called " + setterName
                            + " on class " + getter.getDeclaringClass(), e);
                }
                setterCache.put(getter, setter);
            }
        }
        
        return setterCache.get(getter);
    }
631355
protected void generateFetchMethods(TableDefinition table, JavaWriter out){
        VertxJavaWriter vOut = (VertxJavaWriter) out;
        String pType = vOut.ref(getStrategy().getFullJavaClassName(table, GeneratorStrategy.Mode.POJO));
        UniqueKeyDefinition primaryKey = table.getPrimaryKey();
        ColumnDefinition firstPrimaryKeyColumn = primaryKey.getKeyColumns().get(0);
        for (ColumnDefinition column : table.getColumns()) {
            final String colName = column.getOutputName();
            final String colClass = getStrategy().getJavaClassName(column);
            final String colType = vOut.ref(getJavaType(column.getType()));
            final String colIdentifier = vOut.ref(getStrategy().getFullJavaIdentifier(column), colRefSegments(column));


            //fetchById is already defined in VertxDAO
            if(!firstPrimaryKeyColumn.equals(column)){


                // fetchBy[Column]([T]...)
                // -----------------------

                generateFindManyByMethods(out, pType, colName, colClass, colType, colIdentifier);
            }


            ukLoop:
            for (UniqueKeyDefinition uk : column.getUniqueKeys()) {

                // If column is part of a single-column unique key...
                if (uk.getKeyColumns().size() == 1 && uk.getKeyColumns().get(0).equals(column) && !uk.isPrimaryKey()) {
                    // fetchOneBy[Column]([T])
                    // -----------------------
                    generateFindOneByMethods(out, pType, colName, colClass, colType, colIdentifier);
                    break ukLoop;
                }
            }
        }
    }
58119
def _writer(func):
    

    name = func.__name__
    return property(fget=lambda self: getattr(self, '_%s' % name), fset=func)