ServiceInfo serviceInfo = context.get(ServiceInfo.class);
File jsFile = getOutputFile(serviceInfo.getName().getLocalPart() + ".js");
BasicNameManager nameManager = BasicNameManager.newNameManager(serviceInfo, null);
NamespacePrefixAccumulator prefixManager = new NamespacePrefixAccumulator(serviceInfo
.getXmlSchemaCollection());
Map<String, String> nsPrefixMap =
CastUtils.cast(
context.get(ToolConstants.CFG_JSPREFIXMAP, Map.class),
String.class, String.class);
if (nsPrefixMap != null) {
for (Map.Entry<String, String> prefixEntry : nsPrefixMap.entrySet()) {
prefixManager.collect(prefixEntry.getValue(), prefixEntry.getKey());
}
}
try {
FileOutputStream fileOutputStream = new FileOutputStream(jsFile);