void addCapability(ModuleCapability capability) { if (!name.equals(capability.getNamespace())) { throw new IllegalArgumentException("Invalid namespace: " + capability.getNamespace() + ": expecting: " + name); //$NON-NLS-1$ //$NON-NLS-2$ } all.add(capability); // by convention we index by the namespace attribute Object index = capability.getAttributes().get(name); if (index == null) { return; } Collection<?> indexCollection = null; if (index instanceof Collection) { indexCollection = (Collection<?>) index; } else if (index.getClass().isArray()) { indexCollection = Arrays.asList((Object[]) index); } if (indexCollection == null) { addIndex(index, capability); } else { for (Object indexKey : indexCollection) { addIndex(indexKey, capability); } } }
void addCapability(ModuleCapability capability) { if (!name.equals(capability.getNamespace())) { throw new IllegalArgumentException("Invalid namespace: " + capability.getNamespace() + ": expecting: " + name); //$NON-NLS-1$ //$NON-NLS-2$ } all.add(capability); // by convention we index by the namespace attribute Object index = capability.getAttributes().get(name); if (index == null) { return; } Collection<?> indexCollection = null; if (index instanceof Collection) { indexCollection = (Collection<?>) index; } else if (index.getClass().isArray()) { indexCollection = Arrays.asList((Object[]) index); } if (indexCollection == null) { addIndex(index, capability); } else { for (Object indexKey : indexCollection) { addIndex(indexKey, capability); } } }
void addCapability(ModuleCapability capability) { if (!name.equals(capability.getNamespace())) { throw new IllegalArgumentException("Invalid namespace: " + capability.getNamespace() + ": expecting: " + name); //$NON-NLS-1$ //$NON-NLS-2$ } all.add(capability); // by convention we index by the namespace attribute Object index = capability.getAttributes().get(name); if (index == null) { return; } Collection<?> indexCollection = null; if (index instanceof Collection) { indexCollection = (Collection<?>) index; } else if (index.getClass().isArray()) { indexCollection = Arrays.asList((Object[]) index); } if (indexCollection == null) { addIndex(index, capability); } else { for (Object indexKey : indexCollection) { addIndex(indexKey, capability); } } }
void addCapability(ModuleCapability capability) { if (!name.equals(capability.getNamespace())) { throw new IllegalArgumentException("Invalid namespace: " + capability.getNamespace() + ": expecting: " + name); //$NON-NLS-1$ //$NON-NLS-2$ } all.add(capability); // by convention we index by the namespace attribute Object index = capability.getAttributes().get(name); if (index == null) { return; } Collection<?> indexCollection = null; if (index instanceof Collection) { indexCollection = (Collection<?>) index; } else if (index.getClass().isArray()) { indexCollection = Arrays.asList((Object[]) index); } if (indexCollection == null) { addIndex(index, capability); } else { for (Object indexKey : indexCollection) { addIndex(indexKey, capability); } } }
void addCapability(ModuleCapability capability) { if (!name.equals(capability.getNamespace())) { throw new IllegalArgumentException("Invalid namespace: " + capability.getNamespace() + ": expecting: " + name); //$NON-NLS-1$ //$NON-NLS-2$ } all.add(capability); // by convention we index by the namespace attribute Object index = capability.getAttributes().get(name); if (index == null) { return; } Collection<?> indexCollection = null; if (index instanceof Collection) { indexCollection = (Collection<?>) index; } else if (index.getClass().isArray()) { indexCollection = Arrays.asList((Object[]) index); } if (indexCollection == null) { addIndex(index, capability); } else { for (Object indexKey : indexCollection) { addIndex(indexKey, capability); } } }
void addCapability(ModuleCapability capability) { if (!name.equals(capability.getNamespace())) { throw new IllegalArgumentException("Invalid namespace: " + capability.getNamespace() + ": expecting: " + name); //$NON-NLS-1$ //$NON-NLS-2$ } all.add(capability); // by convention we index by the namespace attribute Object index = capability.getAttributes().get(name); if (index == null) { return; } Collection<?> indexCollection = null; if (index instanceof Collection) { indexCollection = (Collection<?>) index; } else if (index.getClass().isArray()) { indexCollection = Arrays.asList((Object[]) index); } if (indexCollection == null) { addIndex(index, capability); } else { for (Object indexKey : indexCollection) { addIndex(indexKey, capability); } } }