final String registryName = registry.getName();
// - only register if we haven't yet registered the namespace resource
if (!this.registeredNamespaceResources.contains(resource))
{
final Namespaces namespaces = Namespaces.instance();
final String namespace = registry.isShared() ? Namespaces.DEFAULT : registry.getName();
// - first merge on the namespace registry descriptor (if needed)
final Merger merger = Merger.instance();
boolean requiresMerge = merger.requiresMerge(namespace);
if (requiresMerge)
{
registry =
(NamespaceRegistry)registryFactory.getObject(
merger.getMergedString(
ResourceUtils.getContents(resource),
namespace), resource);
}
// - add the resource root
registry.addResourceRoot(this.getNamespaceResourceRoot(resource));
// - only log the fact we've found the namespace registry, if we haven't done it yet
if (!this.registeredRegistries.contains(registryName))
{
AndroMDALogger.info("found namespace --> '" + registryName + "'");
this.registeredRegistries.add(registryName);
}
final NamespaceRegistry existingRegistry = namespaces.getRegistry(registryName);
if (existingRegistry != null)
{
// - if we already have an existing registry with the same name, copy
// over any resources.
registry.copy(existingRegistry);
}
// - add the registry to the namespaces instance
namespaces.addRegistry(registry);
final String[] components = registry.getRegisteredComponents();
final int componentNumber = components.length;
for (int componentCtr = 0; componentCtr < componentNumber; componentCtr++)
{
final String componentName = components[componentCtr];