// The class name of the resource module must match the file name
// without the extension.
String fileName = resourceModuleFile.getName();
String className = fileName.substring(0, fileName.length() - 3);
StandardDefs standardDefs = ThreadLocalToolkit.getStandardDefs();
// Generate the code.
String lineSep = System.getProperty("line.separator");
String[] codePieces = new String[]
{
"package ", lineSep,
"{", lineSep,
lineSep,
"import flash.utils.getDefinitionByName", lineSep,
"import ", standardDefs.getModulesPackage(), ".ModuleBase;", lineSep,
"import ", standardDefs.getResourcesPackage(), ".IResourceModule;", lineSep,
"import ", standardDefs.getResourcesPackage(), ".ResourceBundle;", lineSep,
lineSep,
"[ExcludeClass]", lineSep, lineSep,
codegenResourceBundleMetadata(bundleNames), lineSep,
"public class ", className, " extends ModuleBase", lineSep,
" implements IResourceModule", lineSep,