protected JavaField getNamespaces(PropertySG pController, JavaSource pSource) throws SAXException {
if (namespaceList.isAny() || namespaceList.isOther()) {
return null;
}
String namespaces = pController.getXMLFieldName() + "Namespaces";
JavaField jf = pSource.newJavaField(namespaces, Set.class);
jf.setStatic(true);
jf.setFinal(true);
JavaClassInitializer jci = pSource.newJavaClassInitializer();
LocalJavaField set = jci.newJavaField(Set.class);
set.addLine("new ", HashSet.class, "()");
XsAnyURI[] uris = namespaceList.getUris();
for (int i = 0; i < uris.length; i++) {
jci.addLine(set, ".add(", JavaSource.getQuoted(uris[i].toString()), ");");
}
jci.addLine(jf, " = ", Collections.class, ".unmodifiableSet(", set, ");");
return jf;
}