net.jangaroo.exml.generator.MxmlLibraryManifestGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of exml-compiler Show documentation
Show all versions of exml-compiler Show documentation
parses an EXML and generates an AS config class
package net.jangaroo.exml.generator;
import net.jangaroo.exml.model.ConfigClass;
import net.jangaroo.exml.model.ConfigClassRegistry;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
public class MxmlLibraryManifestGenerator {
private final ConfigClassRegistry configClassRegistry;
public MxmlLibraryManifestGenerator(ConfigClassRegistry configClassRegistry) {
this.configClassRegistry = configClassRegistry;
}
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 sourceConfigClasses = configClassRegistry.getSourceConfigClasses();
List classes = new ArrayList(sourceConfigClasses.size() * 2);
for (ConfigClass configClass : sourceConfigClasses) {
classes.add(configClass.getComponentClassName());
}
Collections.sort(classes);
out.println("");
out.println("");
for (String aClass : classes) {
out.printf(" %n", aClass);
}
out.println(" ");
out.close();
return outputFile;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy