Search in sources :

Example 16 with ConfigClass

use of net.jangaroo.exml.model.ConfigClass in project jangaroo-tools by CoreMedia.

the class MxmlLibraryManifestGenerator method createManifestFile.

public File createManifestFile() throws FileNotFoundException, UnsupportedEncodingException {
    // create catalog.xml component library:
    File outputFile = new File(configClassRegistry.getConfig().getSourcePath().get(0), "manifest.xml");
    System.out.printf("Creating manifest file %s...%n", outputFile.getPath());
    PrintStream out = new PrintStream(new FileOutputStream(outputFile), true, net.jangaroo.exml.api.Exmlc.OUTPUT_CHARSET);
    Collection<ConfigClass> sourceConfigClasses = configClassRegistry.getSourceConfigClasses();
    List<String> classes = new ArrayList<String>(sourceConfigClasses.size() * 2);
    for (ConfigClass configClass : sourceConfigClasses) {
        classes.add(configClass.getComponentClassName());
    }
    Collections.sort(classes);
    out.println("<?xml version=\"1.0\"?>");
    out.println("<componentPackage>");
    for (String aClass : classes) {
        out.printf("  <component class=\"%s\"/>%n", aClass);
    }
    out.println("</componentPackage>");
    out.close();
    return outputFile;
}
Also used : ConfigClass(net.jangaroo.exml.model.ConfigClass) PrintStream(java.io.PrintStream) FileOutputStream(java.io.FileOutputStream) ArrayList(java.util.ArrayList) File(java.io.File)

Aggregations

ConfigClass (net.jangaroo.exml.model.ConfigClass)16 Test (org.junit.Test)8 File (java.io.File)3 ConfigAttribute (net.jangaroo.exml.model.ConfigAttribute)3 Element (org.w3c.dom.Element)3 ArrayList (java.util.ArrayList)2 ExmlcException (net.jangaroo.exml.api.ExmlcException)2 JsonObject (net.jangaroo.exml.json.JsonObject)2 BufferedInputStream (java.io.BufferedInputStream)1 FileInputStream (java.io.FileInputStream)1 FileOutputStream (java.io.FileOutputStream)1 PrintStream (java.io.PrintStream)1 HashSet (java.util.HashSet)1 ExmlConfiguration (net.jangaroo.exml.config.ExmlConfiguration)1 Code (net.jangaroo.exml.json.Code)1 AnnotationAt (net.jangaroo.exml.model.AnnotationAt)1 ConfigClassRegistry (net.jangaroo.exml.model.ConfigClassRegistry)1 Declaration (net.jangaroo.exml.model.Declaration)1 ExmlModel (net.jangaroo.exml.model.ExmlModel)1 PublicApiMode (net.jangaroo.exml.model.PublicApiMode)1