}
return extClass;
}
private static void generateClassModel(ExtClass extClass) {
CompilationUnitModel extAsClassUnit = createClassModel(convertType(extClass.name));
ClassModel extAsClass = (ClassModel)extAsClassUnit.getPrimaryDeclaration();
System.out.printf("Generating AS3 API model %s for %s...%n", extAsClassUnit.getQName(), extClass.name);
//configClass.setName(extClass.aliases.get("widget").get(0));
//configClass.setPackage("ext.config");
extAsClass.setAsdoc(toAsDoc(extClass.doc));
CompilationUnitModel extAsInterfaceUnit = null;
if (interfaces.contains(extClass.name)) {
extAsInterfaceUnit = createClassModel(convertToInterface(extClass.name));
System.out.printf("Generating AS3 API model %s for %s...%n", extAsInterfaceUnit.getQName(), extClass.name);
ClassModel extAsInterface = (ClassModel)extAsInterfaceUnit.getPrimaryDeclaration();
extAsInterface.setInterface(true);
extAsInterface.setAsdoc(toAsDoc(extClass.doc));
addInterfaceForSuperclass(extClass, extAsInterface);
}
if (isSingleton(extClass)) {
FieldModel singleton = new FieldModel(CompilerUtils.className(extClass.name), extAsClassUnit.getQName());
singleton.setConst(true);
singleton.setValue("new " + extAsClassUnit.getQName());
singleton.setAsdoc(extAsClass.getAsdoc());
CompilationUnitModel singletonUnit = new CompilationUnitModel(extAsClassUnit.getPackage(), singleton);
compilationUnitModelRegistry.register(singletonUnit);
extAsClass.setAsdoc(String.format("%s\n<p>Type of singleton %s.</p>\n * @see %s %s",
extAsClass.getAsdoc(),
singleton.getName(),
CompilerUtils.qName(extAsClassUnit.getPackage(), "#" + singleton.getName()),
singletonUnit.getQName()));
}
extAsClass.setSuperclass(convertType(extClass.extends_));
if (extAsInterfaceUnit != null) {
extAsClass.addInterface(extAsInterfaceUnit.getQName());
}