Writes code to an output stream, optionally wrapping it in an arbitrary wrapper that contains a
placeholder where the code should be inserted.

@param module Which module to write. If this is null, write the entire AST.
421267
@GwtIncompatible("Unnecessary")
  void writeOutput(
      Appendable out,
      Compiler compiler,
      @Nullable JSModule module,
      String wrapper,
      String codePlaceholder,
      @Nullable Function<String, String> escaper)
      throws IOException {
    if (compiler.getOptions().outputJs == OutputJs.SENTINEL) {
      out.append("// No JS output because the compiler was run in checks-only mode.\n");
      return;
    }
    checkState(compiler.getOptions().outputJs == OutputJs.NORMAL);

    String code = module == null ? compiler.toSource() : compiler.toSource(module);
    writeOutput(out, compiler, code, wrapper, codePlaceholder, escaper);
  }
212251
@Override
    public void write(final OutputStream out, final Buffer payload) throws IOException {
        this.getParentPacket().write(out, Buffers.wrap(this.msg.toBuffer(), payload));
    }
202300
public void addModule(Module module) {
        LOGGER.debug("adding module {}", module);
        module.setupModule(new ModuleContextImpl(module));
        modules.add(module);
    }
106715
@Override
    public void initModule() throws ModuleInitializationException {

        String dsMediation = getParameter("doMediateDatastreams");
        if (dsMediation == null) {
            throw new ModuleInitializationException("doMediateDatastreams parameter must be specified.",
                                                    getRole());
        }
    }
979796
public void write(ByteCodeWriter out)
    throws IOException
  {
    out.writeUTF8Const(getName());
    out.writeInt(_value.length);
    out.write(_value, 0, _value.length);
  }
970663
private void writeBean(String currentIndent, String tagName, StringBuilder attrs, Class<?> propType, Bean value) throws IOException {
        if (value == null) {
            throw new IllegalArgumentException("Bean cannot be null");
        }
        output.append(currentIndent).append('<').append(tagName).append(attrs);
        if (value.getClass() != propType) {
            String typeStr = SerTypeMapper.encodeType(value.getClass(), settings, basePackage, knownTypes);
            appendAttribute(output, TYPE, typeStr);
        }
        if (willWriteBean(value)) {
            output.append('>').append(settings.getNewLine());
            writeBean(value, currentIndent + settings.getIndent());
            output.append(currentIndent).append('<').append('/').append(tagName).append('>').append(settings.getNewLine());
        } else {
            output.append('/').append('>').append(settings.getNewLine());
        }
    }
424980
public void loadModule(final JsiiModule module) {
        try {
            String tarball = extractResource(module.getModuleClass(), module.getBundleResourceName(), null);
            ObjectNode req = makeRequest("load");
            req.put("tarball", tarball);
            req.put("name", module.getModuleName());
            req.put("version", module.getModuleVersion());
            this.runtime.requestResponse(req);
        } catch (IOException e) {
            throw new JsiiException("Unable to extract resource " + module.getBundleResourceName(), e);
        }
    }
577047
@Override
    public void generate(final Module module, final Element element) {
        // this is not necessary, it is done to avoid the namespace definition
        // in every item.
        Element root = element;
        while (root.getParent() != null && root.getParent() instanceof Element) {
            root = (Element) element.getParent();
        }
        root.addNamespaceDeclaration(GeoRSSModule.SIMPLE_NS);
        root.addNamespaceDeclaration(GeoRSSModule.GML_NS);

        final Element whereElement = new Element("where", GeoRSSModule.SIMPLE_NS);
        element.addContent(whereElement);

        final GeoRSSModule geoRSSModule = (GeoRSSModule) module;
        final AbstractGeometry geometry = geoRSSModule.getGeometry();

        if (geometry instanceof Point) {
            final Position pos = ((Point) geometry).getPosition();

            final Element pointElement = new Element("Point", GeoRSSModule.GML_NS);
            whereElement.addContent(pointElement);

            final Element posElement = new Element("pos", GeoRSSModule.GML_NS);
            posElement.addContent(String.valueOf(pos.getLatitude()) + " " + String.valueOf(pos.getLongitude()));
            pointElement.addContent(posElement);
        }

        else if (geometry instanceof LineString) {
            final PositionList posList = ((LineString) geometry).getPositionList();

            final Element lineElement = new Element("LineString", GeoRSSModule.GML_NS);
            lineElement.addContent(createPosListElement(posList));
            whereElement.addContent(lineElement);
        } else if (geometry instanceof Polygon) {
            final Element polygonElement = new Element("Polygon", GeoRSSModule.GML_NS);
            {
                final AbstractRing ring = ((Polygon) geometry).getExterior();
                if (ring instanceof LinearRing) {
                    final Element exteriorElement = new Element("exterior", GeoRSSModule.GML_NS);
                    polygonElement.addContent(exteriorElement);
                    final Element ringElement = new Element("LinearRing", GeoRSSModule.GML_NS);
                    exteriorElement.addContent(ringElement);
                    ringElement.addContent(createPosListElement(((LinearRing) ring).getPositionList()));

                } else {
                    System.err.println("GeoRSS GML format can't handle rings of type: " + ring.getClass().getName());
                }
            }
            final List<AbstractRing> interiorList = ((Polygon) geometry).getInterior();
            final Iterator<AbstractRing> it = interiorList.iterator();
            while (it.hasNext()) {
                final AbstractRing ring = it.next();
                if (ring instanceof LinearRing) {
                    final Element interiorElement = new Element("interior", GeoRSSModule.GML_NS);
                    polygonElement.addContent(interiorElement);
                    final Element ringElement = new Element("LinearRing", GeoRSSModule.GML_NS);
                    interiorElement.addContent(ringElement);
                    ringElement.addContent(createPosListElement(((LinearRing) ring).getPositionList()));

                } else {
                    System.err.println("GeoRSS GML format can't handle rings of type: " + ring.getClass().getName());
                }
            }
            whereElement.addContent(polygonElement);
        } else if (geometry instanceof Envelope) {
            final Envelope envelope = (Envelope) geometry;
            final Element envelopeElement = new Element("Envelope", GeoRSSModule.GML_NS);
            whereElement.addContent(envelopeElement);

            final Element lowerElement = new Element("lowerCorner", GeoRSSModule.GML_NS);
            lowerElement.addContent(String.valueOf(envelope.getMinLatitude()) + " " + String.valueOf(envelope.getMinLongitude()));
            envelopeElement.addContent(lowerElement);

            final Element upperElement = new Element("upperCorner", GeoRSSModule.GML_NS);
            upperElement.addContent(String.valueOf(envelope.getMaxLatitude()) + " " + String.valueOf(envelope.getMaxLongitude()));
            envelopeElement.addContent(upperElement);

        } else {
            System.err.println("GeoRSS GML format can't handle geometries of type: " + geometry.getClass().getName());
        }
    }
814808
public static void writeTag(OutputStream out, Tag tag, boolean littleEndian) throws IOException {
        writeTag((DataOutput) (littleEndian ? new LittleEndianDataOutputStream(out) : new DataOutputStream(out)), tag);
    }
321564
public void writeModule(Writer writer) throws IOException {
		writer.append(TAB).append("try").append(SPACEOPTIONAL).append(OPENBRACE).append(CR); // \ttry {\n
		writer.append(TAB2).append(ANGULAR_MODULE).append(OPENPARENTHESIS).append(MODULENAME).append(CLOSEPARENTHESIS)
				  .append(SEMICOLON).append(CR); // \tangular.module('ocelot.ds');\n
		writer.append(TAB).append(CLOSEBRACE).append(SPACEOPTIONAL).append("catch").append(SPACEOPTIONAL)
				  .append(OPENPARENTHESIS).append("e").append(CLOSEPARENTHESIS).append(SPACEOPTIONAL).append(OPENBRACE)
				  .append(CR); // \t} catch (e) {\n
		writer.append(TAB2).append(ANGULAR_MODULE).append(OPENPARENTHESIS).append(MODULENAME).append(COMMA)
				  .append(SPACEOPTIONAL).append(BRACKETS).append(CLOSEPARENTHESIS).append(SEMICOLON)
				  .append(CR); // \t\tangular.module('ocelot.ds', []);\n
		writer.append(TAB).append(CLOSEBRACE).append(CR); // \t}\n
	}
332954
@Override
  void write(ByteCodeWriter out)
    throws IOException
  {
    out.write(ConstantPool.CP_INVOKEDYNAMIC);
    out.writeShort(_bootstrapMethodAttrIndex);
    out.writeShort(_nameAndTypeIndex);
  }
833807
private Element writeModule() {
        Element element = doc.createElement("module");
        rootElement.appendChild(element);
        return element;
    }
415286
function outputModuleDefinitions (module, headWasOutput)
  {
    for (var i = 0, m = module.bodies.length; i < m; ++i) {
      var bodyPath = module.bodyPaths[i];
      if (!bodyPath)
        console.log (module.name, i, module.bodies.length, module.bodyPaths);
      // Skip bodies who's corresponding file was already output.
      if (context.outputtedFiles[bodyPath])
        continue;
      context.outputtedFiles[bodyPath] = true;

      var body = module.optimize ?
        optimize (module.bodies[i], bodyPath, module)
        : {status: STAT.INDENTED, data: module.bodies[i]};

      if (i || !headWasOutput)
        traceOutput.push (LINE, '// File: ' + bodyPath, LINE, '');
      traceOutput.push (conditionalIndent (body));
    }
  }
1220420
public void write(Writer out)
            throws XmlModelWriterException, IOException
    {
        try
        {
            DOMSource domSource = new DOMSource(_doc);
            StreamResult streamResult = new StreamResult(out);
            TransformerFactory tf = TransformerFactory.newInstance();
            tf.setAttribute("indent-number", new Integer(INDENT_LEN));
            Transformer serializer = tf.newTransformer();
            if (_publicID != null) {
                serializer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, _publicID);
            }
            if (_systemID != null) {
                serializer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, _systemID);
            }
            serializer.setOutputProperty(OutputKeys.INDENT, "yes");
            serializer.transform(domSource, streamResult);
        }
        catch (TransformerException e)
        {
            throw new XmlModelWriterException(e);
        }
    }
1312018
function Module (rawModule, runtime) {
  this.runtime = runtime;
  // Store some children item
  this._children = Object.create(null);
  // Store the origin module object which passed by programmer
  this._rawModule = rawModule;
  var rawState = rawModule.state;

  // Store the origin module's state
  this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
}
867883
public void writeTo(final OutputStream output) throws IOException {
    final CodedOutputStream codedOutput = CodedOutputStream.newInstance(output);
    writeTo(codedOutput);
    codedOutput.flush();
  }
1103999
void write(ByteCodeWriter out)
    throws IOException
  {
    out.write(ConstantPool.CP_STRING);
    out.writeShort(_stringIndex);
  }