@Test public void bdxr201605DocumentIdentifers() throws Exception { List<ServiceReference> result = reader.parseServiceGroup(new FetcherResponse( getClass().getResourceAsStream("/bdxr201605-servicegroup-9908-991825827.xml"), null)); assertEquals(result.size(), 7); }
@Override public List<ServiceReference> parseServiceGroup(FetcherResponse fetcherResponse) throws LookupException { FetcherResponse response = fetcherResponse; if (response.getNamespace() == null) response = detect(response); for (MetadataReader metadataReader : METADATA_READERS) if (metadataReader.getClass().getAnnotation(Namespace.class).value().equalsIgnoreCase(response.getNamespace())) return metadataReader.parseServiceGroup(response); throw new LookupException(String.format("Unknown namespace: %s", response.getNamespace())); }
MultiReader implements MetadataReader { @Override public List<ServiceReference> parseServiceGroup(FetcherResponse fetcherResponse) throws LookupException { FetcherResponse response = fetcherResponse; if (response.getNamespace() == null) response = detect(response); for (MetadataReader metadataReader : METADATA_READERS) if (metadataReader.getClass().getAnnotation(Namespace.class).value().equalsIgnoreCase(response.getNamespace())) return metadataReader.parseServiceGroup(response); throw new LookupException(String.format("Unknown namespace: %s", response.getNamespace())); } }
MultiReader implements MetadataReader { @Override public List<ServiceReference> parseServiceGroup(FetcherResponse fetcherResponse) throws LookupException { FetcherResponse response = fetcherResponse; if (response.getNamespace() == null) response = detect(response); for (MetadataReader metadataReader : METADATA_READERS) if (metadataReader.getClass().getAnnotation(Namespace.class).value().equalsIgnoreCase(response.getNamespace())) return metadataReader.parseServiceGroup(response); throw new LookupException(String.format("Unknown namespace: %s", response.getNamespace())); }  }
MultiReader implements MetadataReader { @Override public List<ServiceReference> parseServiceGroup(FetcherResponse fetcherResponse) throws LookupException { FetcherResponse response = fetcherResponse; if (response.getNamespace() == null) response = detect(response); for (MetadataReader metadataReader : METADATA_READERS) if (metadataReader.getClass().getAnnotation(Namespace.class).value().equalsIgnoreCase(response.getNamespace())) return metadataReader.parseServiceGroup(response); throw new LookupException(String.format("Unknown namespace: %s", response.getNamespace())); }  @Override List<ServiceReference> parseServiceGroup(FetcherResponse fetcherResponse); @Override PotentiallySigned<ServiceMetadata> parseServiceMetadata(FetcherResponse fetcherResponse); FetcherResponse detect(FetcherResponse fetcherResponse); }
MultiReader implements MetadataReader { @Override public List<ServiceReference> parseServiceGroup(FetcherResponse fetcherResponse) throws LookupException { FetcherResponse response = fetcherResponse; if (response.getNamespace() == null) response = detect(response); for (MetadataReader metadataReader : METADATA_READERS) if (metadataReader.getClass().getAnnotation(Namespace.class).value().equalsIgnoreCase(response.getNamespace())) return metadataReader.parseServiceGroup(response); throw new LookupException(String.format("Unknown namespace: %s", response.getNamespace())); }  @Override List<ServiceReference> parseServiceGroup(FetcherResponse fetcherResponse); @Override PotentiallySigned<ServiceMetadata> parseServiceMetadata(FetcherResponse fetcherResponse); FetcherResponse detect(FetcherResponse fetcherResponse);  }