AntPatternMatcher matcher = new AntPatternMatcher();
matcher.setPathSeparator(".");
for (WebFault webFault : allFaults.values()) {
if (useServerSide(webFault, matcher)) {
SourcePosition position = webFault.getPosition();
if (position == null || position.file() == null) {
throw new IllegalStateException("Unable to find source file for " + webFault.getQualifiedName());
}
File sourceFile = position.file();
getEnunciate().copyFile(sourceFile, getServerSideDestFile(sourceFile, webFault));
}
else {
ClassDeclaration superFault = webFault.getSuperclass().getDeclaration();
if (superFault != null && allFaults.containsKey(superFault.getQualifiedName()) && allFaults.get(superFault.getQualifiedName()).isImplicitSchemaElement()) {
model.put("superFault", allFaults.get(superFault.getQualifiedName()));
}
else {
model.remove("superFault");
}
model.put("fault", webFault);
processTemplate(faultTemplate, model);
}
}
final Set<String> uniquePackages = new TreeSet<String>();
for (SchemaInfo schemaInfo : model.getNamespacesToSchemas().values()) {
for (TypeDefinition typeDefinition : schemaInfo.getTypeDefinitions()) {
if (FacetFilter.accept(typeDefinition)) {
if (useServerSide(typeDefinition, matcher)) {
SourcePosition position = typeDefinition.getPosition();
if (position == null || position.file() == null) {
throw new IllegalStateException("Unable to find source file for " + typeDefinition.getQualifiedName());
}
File sourceFile = position.file();
getEnunciate().copyFile(sourceFile, getServerSideDestFile(sourceFile, typeDefinition));
}
else {
model.put("rootEl", model.findRootElementDeclaration(typeDefinition));
model.put("type", typeDefinition);