}
}
debug("Generating the AMF externalizable types and their associated mappers...");
AMFClassnameForMethod amfClassnameForMethod = new AMFClassnameForMethod(packages);
model.put("simpleNameFor", new SimpleNameWithParamsMethod(amfClassnameForMethod));
model.put("classnameFor", amfClassnameForMethod);
for (SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
for (TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
if (!isFacetExcluded(typeDefinition)) {
model.put("type", typeDefinition);
processTemplate(amfTypeTemplate, model);
processTemplate(amfTypeMapperTemplate, model);
}
}
}
debug("Generating the AMF endpoint beans...");
for (WsdlInfo wsdlInfo : model.getNamespacesToWSDLs().values()) {
for (EndpointInterface ei : wsdlInfo.getEndpointInterfaces()) {
if (!isFacetExcluded(ei)) {
model.put("endpointInterface", ei);
processTemplate(amfEndpointTemplate, model);
}
}
}
URL endpointTemplate = getTemplateURL("as3-endpoint.fmt");
URL typeTemplate = getTemplateURL("as3-type.fmt");
URL enumTypeTemplate = getTemplateURL("as3-enum-type.fmt");
//build up the list of as3Aliases...
HashMap<String, String> as3Aliases = new HashMap<String, String>();
for (SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
for (TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
if (!isFacetExcluded(typeDefinition)) {
as3Aliases.put(amfClassnameForMethod.convert(typeDefinition), typeDefinition.getClientSimpleName());
}
}
}
model.setFileOutputDirectory(clientGenerateDir);
HashMap<String, String> conversions = new HashMap<String, String>();
//todo: accept client-side package mappings?
ClientPackageForMethod as3PackageFor = new ClientPackageForMethod(conversions);
as3PackageFor.setUseClientNameConversions(true);
model.put("packageFor", as3PackageFor);
AS3UnqualifiedClassnameForMethod as3ClassnameFor = new AS3UnqualifiedClassnameForMethod(conversions);
as3ClassnameFor.setUseClientNameConversions(true);
model.put("classnameFor", as3ClassnameFor);
model.put("simpleNameFor", new SimpleNameWithParamsMethod(as3ClassnameFor));
ComponentTypeForMethod as3ComponentTypeFor = new ComponentTypeForMethod(conversions);
as3ComponentTypeFor.setUseClientNameConversions(true);
model.put("componentTypeFor", as3ComponentTypeFor);
model.put("amfClassnameFor", amfClassnameForMethod);
model.put("amfComponentTypeFor", new ComponentTypeForMethod(packages));