Generate the package use list.
@throws DocFileIOException if there is a problem generating the package use page
340190
protected void generatePackageUseFile() throws DocFileIOException {
        HtmlTree body = getPackageUseHeader();
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
        div.addStyle(HtmlStyle.contentContainer);
        if (usingPackageToUsedClasses.isEmpty()) {
            div.addContent(contents.getContent("doclet.ClassUse_No.usage.of.0", utils.getPackageName(packageElement)));
        } else {
            addPackageUse(div);
        }
        if (configuration.allowTag(HtmlTag.MAIN)) {
            mainTree.addContent(div);
            body.addContent(mainTree);
        } else {
            body.addContent(div);
        }
        HtmlTree tree = (configuration.allowTag(HtmlTag.FOOTER))
                ? HtmlTree.FOOTER()
                : body;
        addNavLinks(false, tree);
        addBottom(tree);
        if (configuration.allowTag(HtmlTag.FOOTER)) {
            body.addContent(tree);
        }
        printHtmlDocument(null, true, body);
    }
1060588
public void generate() throws IOException {
        final Document doc = DocumentFactory.getInstance().createDocument();
        final Element root = doc.addElement("project");
        //iterate through entities in correct order
        for (final ResourceXMLParser.Entity entity : entities) {
            if (NODE_ENTITY_TAG.equals(entity.getResourceType())) {
                final Element ent = genEntityCommon(root, entity);
                genNode(ent, entity);
            }
        }

        if (null != file) {
            FileOutputStream out=new FileOutputStream(file);
            try{
                serializeDocToStream(out, doc);
            }finally{
                out.close();
            }
        } else if (null != output) {
            serializeDocToStream(output, doc);
        }
    }
937414
protected function _generateFiles() {
        foreach ($this->getRegisteredArtifacts() as $artifact) {
            $featureName = $artifact->getFeature()->getName();
            if (array_search($featureName, $this->featureOrder) === false)
                throw new CollaborationGeneratorException("no feature order supplied for \"$featureName\"");
        }
        
        parent::_generateFiles();

        $rolePartition = fphp\Helper\Partition::fromObjects($this->collaborations, "getRoles")->partitionBy("correspondsTo");
        foreach ($rolePartition as $roleEquivalenceClass) {
            // sort the roles by their feature order (because role composition is not commutative)
            $roleEquivalenceClass = fphp\Helper\_Array::schwartzianTransform($roleEquivalenceClass, function($role) {
                return array_search($role->getCollaboration()->getArtifact()->getFeature()->getName(), $this->featureOrder);
            });
            
            // take any representative from the equivalence class to extract the file target
            $fileTarget = $roleEquivalenceClass[0]->getFileSpecification()->getTarget();
            $this->files[] = new fphp\File\RefinedFile($fileTarget, $roleEquivalenceClass);
            $this->logFile->log(null, "added file \"$fileTarget\"");
        }
    }
650912
private function generateMethods(): void
    {
        $this->printer->writeln('Generating methods.');
        $this->generator->setChildNamespace('Method');

        /** @var Method $method */
        foreach ($this->wsdl->getMethods() as $name => $method) {
            $this->printer->writeln(" |\-Generating method $name");
            $code = $method->visit($this->generator);
            $className = $this->findClassName($code);
            $filename = $this->destination . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php';

            $this->writer->writeFile($filename, $code);
            $this->printer->writeln("  |- Wrote $className to $filename");
        }
    }
1258712
protected void addPackageList(Content contentTree) throws IOException {
        Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, useTableSummary,
                getTableCaption(configuration.getResource(
                "doclet.ClassUse_Packages.that.use.0",
                getPackageLink(pkgdoc, Util.getPackageName(pkgdoc)))));
        table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
        Content tbody = new HtmlTree(HtmlTag.TBODY);
        Iterator<String> it = usingPackageToUsedClasses.keySet().iterator();
        for (int i = 0; it.hasNext(); i++) {
            PackageDoc pkg = configuration.root.packageNamed(it.next());
            HtmlTree tr = new HtmlTree(HtmlTag.TR);
            if (i % 2 == 0) {
                tr.addStyle(HtmlStyle.altColor);
            } else {
                tr.addStyle(HtmlStyle.rowColor);
            }
            addPackageUse(pkg, tr);
            tbody.addContent(tr);
        }
        table.addContent(tbody);
        Content li = HtmlTree.LI(HtmlStyle.blockList, table);
        contentTree.addContent(li);
    }
1138863
public static void generate(ConfigurationImpl configuration,
                                ClassUseMapper mapper, ClassDoc classdoc) {
        ClassUseWriter clsgen;
        DocPath path = DocPath.forPackage(classdoc)
                .resolve(DocPaths.CLASS_USE)
                .resolve(DocPath.forName(classdoc));
        try {
            clsgen = new ClassUseWriter(configuration,
                                        mapper, path,
                                        classdoc);
            clsgen.generateClassUseFile();
            clsgen.close();
        } catch (IOException exc) {
            configuration.standardmessage.
                error("doclet.exception_encountered",
                      exc.toString(), path.getPath());
            throw new DocletAbortException(exc);
        }
    }
274946
protected void addClassList(Content contentTree) {
        List<String> classTableHeader = Arrays.asList(
                resources.getText("doclet.Class"), resources.getText("doclet.Description"));
        for (String packageName : usingPackageToUsedClasses.keySet()) {
            PackageElement usingPackage = utils.elementUtils.getPackageElement(packageName);
            HtmlTree li = new HtmlTree(HtmlTag.LI);
            li.addStyle(HtmlStyle.blockList);
            if (usingPackage != null) {
                li.addContent(getMarkerAnchor(utils.getPackageName(usingPackage)));
            }
            String tableSummary = configuration.getText("doclet.Use_Table_Summary",
                                                        configuration.getText("doclet.classes"));
            Content caption = getTableCaption(configuration.getContent(
                    "doclet.ClassUse_Classes.in.0.used.by.1",
                    getPackageLink(packageElement, utils.getPackageName(packageElement)),
                    getPackageLink(usingPackage, utils.getPackageName(usingPackage))));
            Content table = (configuration.isOutputHtml5())
                    ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
                    : HtmlTree.TABLE(HtmlStyle.useSummary, tableSummary, caption);
            table.addContent(getSummaryTableHeader(classTableHeader, "col"));
            Content tbody = new HtmlTree(HtmlTag.TBODY);
            boolean altColor = true;
            for (TypeElement te : usingPackageToUsedClasses.get(packageName)) {
                HtmlTree tr = new HtmlTree(HtmlTag.TR);
                tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
                altColor = !altColor;
                addClassRow(te, usingPackage, tr);
                tbody.addContent(tr);
            }
            table.addContent(tbody);
            li.addContent(table);
            contentTree.addContent(li);
        }
    }
400556
protected Content getPackageUseHeader() {
        String packageText = configuration.getText("doclet.Package");
        String name = pkgdoc.name();
        String title = configuration.getText("doclet.Window_ClassUse_Header",
                packageText, name);
        Content bodyTree = getBody(true, getWindowTitle(title));
        addTop(bodyTree);
        addNavLinks(true, bodyTree);
        ContentBuilder headContent = new ContentBuilder();
        headContent.addContent(getResource("doclet.ClassUse_Title", packageText));
        headContent.addContent(new HtmlTree(HtmlTag.BR));
        headContent.addContent(name);
        Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
                HtmlStyle.title, headContent);
        Content div = HtmlTree.DIV(HtmlStyle.header, heading);
        bodyTree.addContent(div);
        return bodyTree;
    }
291300
public function GenerateOtherSources()
    {
        // Variables used by some template files.
        $authors = \Peg\Lib\Settings::GetAuthors();
        $contributors = \Peg\Lib\Settings::GetContributors();
        $extension = \Peg\Lib\Settings::GetExtensionName();
        $version = \Peg\Lib\Settings::GetVersion();

        // Variable to temporarily store a template file content.
        $content = "";
        
        // Generate common.h
        ob_start();
            include($this->GetGenericTemplate("common.h", "sources"));
            $content = ob_get_contents();
        ob_end_clean();

        $this->AddGenericFile("common.h", $content, "includes");

        // Generate all_headers.h
        $headers = "";
        foreach($this->symbols->headers as $header_name=>$header_object)
        {
            if($header_object->enabled)
            {
                $headers .= '#include "'
                    . $this->GetHeaderNamePHP($header_name)
                    . '"'
                    . "\n"
                ;
            }
        }

        ob_start();
            include($this->GetGenericTemplate("all_headers.h", "sources"));
            $content = ob_get_contents();
        ob_end_clean();

        $this->AddGenericFile("all_headers.h", $content, "includes");

        // Generate functions.h/cpp
        ob_start();
            include($this->GetGenericTemplate("functions.h", "sources"));
            $content = ob_get_contents();
        ob_end_clean();

        $this->AddGenericFile("functions.h", $content, "includes");

        ob_start();
            include($this->GetGenericTemplate("functions.cpp", "sources"));
            $content = ob_get_contents();
        ob_end_clean();

        $this->AddGenericFile("functions.cpp", $content, "src");

        // Generate references.h/cpp
        ob_start();
            include($this->GetGenericTemplate("references.h", "sources"));
            $content = ob_get_contents();
        ob_end_clean();

        $this->AddGenericFile("references.h", $content, "includes");

        ob_start();
            include($this->GetGenericTemplate("references.cpp", "sources"));
            $content = ob_get_contents();
        ob_end_clean();

        $this->AddGenericFile("references.cpp", $content, "src");

        // Generate php_extension.h/c
        $constants_register = "";
        $enums_register = "";
        $functions_register = "";
        $classes_register = "";

        foreach($this->symbols->headers as $header_name=>$header_object)
        {
            $header_define = $this->GetHeaderDefine($header_name);

            if($header_object->enabled)
            {
                if($header_object->HasConstants())
                {
                    ob_start();
                        include($this->GetTemplatePath(
                            $header_name,
                            "constants",
                            "function_call",
                            "helpers",
                            "constant"
                        ));
                        $constants_register .= ob_get_contents();
                    ob_end_clean();
                }

                if($header_object->HasEnumerations())
                {
                    ob_start();
                        include($this->GetTemplatePath(
                            $header_name,
                            "enums",
                            "function_call",
                            "helpers",
                            "enum"
                        ));
                        $enums_register .= ob_get_contents();
                    ob_end_clean();
                }

                if($header_object->HasEnumerations())
                {
                    ob_start();
                        include($this->GetTemplatePath(
                            $header_name,
                            "functions",
                            "function_call",
                            "helpers",
                            "function"
                        ));
                        $functions_register .= ob_get_contents();
                    ob_end_clean();
                }

                if($header_object->HasClasses())
                {
                    foreach($header_object->namespaces as $namespace_name=>$namespace_object)
                    {
                        if($namespace_name == "\\")
                            $namespace_name = "";

                        $namespace_name_cpp = str_replace(
                            "\\",
                            "::",
                            $namespace_name
                        );

                        $namespace_name_var = str_replace(
                            "\\",
                            "_",
                            $namespace_name
                        );

                        foreach($namespace_object->classes as $class_name=>$class_object)
                        {
                            ob_start();
                                include($this->GetTemplatePath(
                                    $class_name,
                                    "classes",
                                    "function_call",
                                    "helpers",
                                    "class"
                                ));
                                $classes_register .= ob_get_contents();
                            ob_end_clean();
                        }
                    }
                }
            }
        }

        $constants_register = $this->Indent($constants_register, 8);
        $enums_register = $this->Indent($enums_register, 8);
        $functions_register = $this->Indent($functions_register, 8);
        $classes_register = $this->Indent($classes_register, 4);

        ob_start();
            include($this->GetGenericTemplate("php_extension.h", "sources"));
            $content = ob_get_contents();
        ob_end_clean();

        $this->AddGenericFile("php_" . strtolower($extension) . ".h", $content);

        ob_start();
            include($this->GetGenericTemplate("extension.c", "sources"));
            $content = ob_get_contents();
        ob_end_clean();

        $this->AddGenericFile(strtolower($extension) . ".c", $content);

        // Generate object_types.h
        $object_types = "";
        foreach($this->symbols->headers as $header_name=>$header_object)
        {
            foreach($header_object->namespaces as $namespace_name=>$namespace_object)
            {
                if($namespace_name == "\\")
                    $namespace_name = "";

                $namespace_name_var = strtoupper(
                        str_replace(
                        "\\",
                        "_",
                        $namespace_name
                    )
                );

                foreach($namespace_object->classes as $class_name=>$class_object)
                {
                    if($namespace_name)
                    {
                        $object_types .= "PHP_"
                            . $namespace_name_var . "_"
                            . strtoupper($class_name)
                            . "_TYPE,"
                            . "\n    "
                        ;
                    }
                    else
                    {
                        $object_types .= "PHP_"
                            . strtoupper($class_name)
                            . "_TYPE,"
                            . "\n    "
                        ;
                    }
                }
            }
        }

        $object_types = rtrim($object_types, "\n, ") . "\n";

        ob_start();
            include($this->GetGenericTemplate("object_types.h", "sources"));
            $content = ob_get_contents();
        ob_end_clean();

        $this->AddGenericFile("object_types.h", $content, "includes");
    }
339926
public static void generate(ConfigurationImpl configuration) throws DocFileIOException {
        DocPath filename = DocPaths.MODULE_OVERVIEW_FRAME;
        ModuleIndexFrameWriter modulegen = new ModuleIndexFrameWriter(configuration, filename);
        modulegen.buildModuleIndexFile("doclet.Window_Overview", false);
    }
312864
protected void generatePackageUseFile() throws IOException {
        Content body = getPackageUseHeader();
        HtmlTree div = new HtmlTree(HtmlTag.DIV);
        div.addStyle(HtmlStyle.contentContainer);
        if (usingPackageToUsedClasses.isEmpty()) {
            div.addContent(getResource(
                    "doclet.ClassUse_No.usage.of.0", pkgdoc.name()));
        } else {
            addPackageUse(div);
        }
        body.addContent(div);
        addNavLinks(false, body);
        addBottom(body);
        printHtmlDocument(null, true, body);
    }
1026326
protected void addPackageList(Content contentTree) {
        Content caption = getTableCaption(configuration.getContent(
                "doclet.ClassUse_Packages.that.use.0",
                getPackageLink(packageElement, utils.getPackageName(packageElement))));
        Content table = (configuration.isOutputHtml5())
                ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
                : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption);
        table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
        Content tbody = new HtmlTree(HtmlTag.TBODY);
        boolean altColor = true;
        for (String pkgname: usingPackageToUsedClasses.keySet()) {
            PackageElement pkg = utils.elementUtils.getPackageElement(pkgname);
            HtmlTree tr = new HtmlTree(HtmlTag.TR);
            tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
            altColor = !altColor;
            addPackageUse(pkg, tr);
            tbody.addContent(tr);
        }
        table.addContent(tbody);
        Content li = HtmlTree.LI(HtmlStyle.blockList, table);
        contentTree.addContent(li);
    }
698157
private static void generatePackageDiagrams(RootDoc root, Options opt, String outputFolder)
	    throws IOException {
	Set<String> packages = new HashSet<String>();
	for (ClassDoc classDoc : root.classes()) {
	    PackageDoc packageDoc = classDoc.containingPackage();
	    if(!packages.contains(packageDoc.name())) {
		packages.add(packageDoc.name());
    	    OptionProvider view = new PackageView(outputFolder, packageDoc, root, opt);
    	    UmlGraph.buildGraph(root, view, packageDoc);
    	    runGraphviz(opt.dotExecutable, outputFolder, packageDoc.name(), packageDoc.name(), root);
    	    alterHtmlDocs(opt, outputFolder, packageDoc.name(), packageDoc.name(),
    		    "package-summary.html", Pattern.compile("(</[Hh]2>)|(<h1 title=\"Package\").*"), root);
	    }
	}
    }
650415
public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes

		// Initialize classes and features; add operations and parameters
		initEClass(documentRootEClass, DocumentRoot.class, "DocumentRoot", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getDocumentRoot_Mixed(), ecorePackage.getEFeatureMapEntry(), "mixed", null, 0, -1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getDocumentRoot_XMLNSPrefixMap(), ecorePackage.getEStringToStringMapEntry(), null, "xMLNSPrefixMap", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getDocumentRoot_XSISchemaLocation(), ecorePackage.getEStringToStringMapEntry(), null, "xSISchemaLocation", null, 0, -1, null, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getDocumentRoot_BackgroundColor(), this.getHexColor(), "backgroundColor", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getDocumentRoot_BorderColor(), this.getHexColor(), "borderColor", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getDocumentRoot_Color(), this.getHexColor(), "color", null, 0, 1, null, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		// Initialize data types
		initEDataType(hexColorEDataType, String.class, "HexColor", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);

		// Create resource
		createResource(eNS_URI);

		// Create annotations
		// http:///org/eclipse/emf/ecore/util/ExtendedMetaData
		createExtendedMetaDataAnnotations();
	}
132534
private void generateJavaCode(Service service, Document iddDoc) throws Exception {

		IDLReader reader = new IDLReader();

		Document extensionDoc = parseExtensionFile(service.getServiceName());

		String packageName = derivePackageName(service, iddDoc);

        reader.init(iddDoc, extensionDoc, service.getServiceName(), packageName, getBaseDir(),
        				generatedSourceDir, getLog(), service.getOutputDir(), isClient(), isServer());

        runMerge(reader);

        // also create the stripped down, combined version of the IDD doc
        getLog().debug("Generating combined IDD sans comments...");
        Document combinedIDDDoc = parseIddFromString(reader.serialize());
        // WARNING: this absolutely has to be run after a call to reader.runMerge (called by runMerge above) as otherwise the version will be null...
        generateExposedIDD(combinedIDDDoc, reader.getInterfaceName(), reader.getInterfaceMajorMinorVersion());

        // generate WSDL/XSD
        getLog().debug("Generating wsdl...");
        generateWsdl(iddDoc, reader.getInterfaceName(), reader.getInterfaceMajorMinorVersion());
        getLog().debug("Generating xsd...");
        generateXsd(iddDoc, reader.getInterfaceName(), reader.getInterfaceMajorMinorVersion());
	}
1234773
public static void generate(ConfigurationImpl configuration,
                                IndexBuilder indexbuilder) throws DocFileIOException {
        DocPath filename = DocPaths.INDEX_ALL;
        SingleIndexWriter indexgen = new SingleIndexWriter(configuration,
                                         filename, indexbuilder);
        indexgen.generateIndexFile();
    }
1226449
public static void generate(ConfigurationImpl configuration) throws DocFileIOException {
        DocPath filename = DocPaths.OVERVIEW_FRAME;
        PackageIndexFrameWriter packgen = new PackageIndexFrameWriter(configuration, filename);
        packgen.buildPackageIndexFile("doclet.Window_Overview", false);
    }