private <T> void checkForDuplicates(List<Metadata<T>> list, MessageCallback<DeploymentException> messageCallback) { Map<T, Metadata<T>> map = new HashMap<T, Metadata<T>>(); for (Metadata<T> item : list) { Metadata<T> previousOccurrence = map.put(item.getValue(), item); if (previousOccurrence != null) { throw messageCallback.construct(item.getValue(), item, previousOccurrence); } } }
private <T> void checkForDuplicates(List<Metadata<T>> list, MessageCallback<DeploymentException> messageCallback) { Map<T, Metadata<T>> map = new HashMap<T, Metadata<T>>(); for (Metadata<T> item : list) { Metadata<T> previousOccurrence = map.put(item.getValue(), item); if (previousOccurrence != null) { throw messageCallback.construct(item.getValue(), item, previousOccurrence); } } }
private <T> void checkForDuplicates(List<Metadata<T>> list, MessageCallback<DeploymentException> messageCallback) { Map<T, Metadata<T>> map = new HashMap<T, Metadata<T>>(); for (Metadata<T> item : list) { Metadata<T> previousOccurrence = map.put(item.getValue(), item); if (previousOccurrence != null) { throw messageCallback.construct(item.getValue(), item, previousOccurrence); } } }
private <T> void checkForDuplicates(List<Metadata<T>> list, MessageCallback<DeploymentException> messageCallback) { Map<T, Metadata<T>> map = new HashMap<T, Metadata<T>>(); for (Metadata<T> item : list) { Metadata<T> previousOccurrence = map.put(item.getValue(), item); if (previousOccurrence != null) { throw messageCallback.construct(item.getValue(), item, previousOccurrence); } } }
@Override public List<String> getDecorators() { List<String> decorators = new ArrayList<>(); for (Metadata<String> decorator : model.getEnabledDecorators()) { decorators.add(decorator.getValue()); } return decorators; }
static void createMetadataArrayJson(JsonArrayBuilder scanBuilder, Collection<Metadata<Filter>> metadata, String type) { if (metadata != null && !metadata.isEmpty()) { for (Metadata<Filter> filterMetadata : metadata) { Filter filter = filterMetadata.getValue(); scanBuilder.add(createFilterJsonArray(filter, type)); } } }
static void createMetadataArrayJson(JsonArrayBuilder scanBuilder, Collection<Metadata<Filter>> metadata, String type) { if (metadata != null && !metadata.isEmpty()) { for (Metadata<Filter> filterMetadata : metadata) { Filter filter = filterMetadata.getValue(); scanBuilder.add(createFilterJsonArray(filter, type)); } } }
static void createMetadataArrayJson(JsonArrayBuilder scanBuilder, Collection<Metadata<Filter>> metadata, String type) { if (metadata != null && !metadata.isEmpty()) { for (Metadata<Filter> filterMetadata : metadata) { Filter filter = filterMetadata.getValue(); scanBuilder.add(createFilterJsonArray(filter, type)); } } }
@Override public Class<?> apply(Metadata<String> from) { try { return resourceLoader.classForName(from.getValue()); } catch (ResourceLoadingException e) { throw BootstrapLogger.LOG.errorLoadingBeansXmlEntry(from.getValue(), from.getLocation(), e.getCause()); } catch (Exception e) { throw BootstrapLogger.LOG.errorLoadingBeansXmlEntry(from.getValue(), from.getLocation(), e); } } }
@Override public Class<?> apply(Metadata<String> from) { try { return resourceLoader.classForName(from.getValue()); } catch (ResourceLoadingException e) { throw BootstrapLogger.LOG.errorLoadingBeansXmlEntry(from.getValue(), from.getLocation(), e.getCause()); } catch (Exception e) { throw BootstrapLogger.LOG.errorLoadingBeansXmlEntry(from.getValue(), from.getLocation(), e); } } }
@Override public Class<?> apply(Metadata<String> from) { try { return resourceLoader.classForName(from.getValue()); } catch (ResourceLoadingException e) { throw BootstrapLogger.LOG.errorLoadingBeansXmlEntry(from.getValue(), from.getLocation(), e.getCause()); } catch (Exception e) { throw BootstrapLogger.LOG.errorLoadingBeansXmlEntry(from.getValue(), from.getLocation(), e); } } }
@Override public Class<?> apply(Metadata<String> from) { try { return resourceLoader.classForName(from.getValue()); } catch (ResourceLoadingException e) { throw BootstrapLogger.LOG.errorLoadingBeansXmlEntry(from.getValue(), from.getLocation(), e.getCause()); } catch (Exception e) { throw BootstrapLogger.LOG.errorLoadingBeansXmlEntry(from.getValue(), from.getLocation(), e); } } }
@Override public Class<?> apply(Metadata<String> from) { try { return resourceLoader.classForName(from.getValue()); } catch (ResourceLoadingException e) { throw BootstrapLogger.LOG.errorLoadingBeansXmlEntry(from.getValue(), from.getLocation(), e.getCause()); } catch (Exception e) { throw BootstrapLogger.LOG.errorLoadingBeansXmlEntry(from.getValue(), from.getLocation(), e); } } }
public WeldModules() { modules = load(WeldModule.class, WeldClassLoaderResourceLoader.INSTANCE).stream().map(metadata -> metadata.getValue()) .sorted((m1, m2) -> m1.getName().compareTo(m2.getName())) .collect(ImmutableList.collector()); this.validators = Collections.emptySet(); BootstrapLogger.LOG.debugv("Using Weld modules: {0}", modules.stream().map(m -> m.getName()).collect(Collectors.toList())); }
public WeldModules() { modules = load(WeldModule.class, WeldClassLoaderResourceLoader.INSTANCE).stream().map(metadata -> metadata.getValue()) .sorted((m1, m2) -> m1.getName().compareTo(m2.getName())) .collect(ImmutableList.collector()); this.validators = Collections.emptySet(); BootstrapLogger.LOG.debugv("Using Weld modules: {0}", modules.stream().map(m -> m.getName()).collect(Collectors.toList())); }
public WeldModules() { modules = load(WeldModule.class, WeldClassLoaderResourceLoader.INSTANCE).stream().map(metadata -> metadata.getValue()) .sorted((m1, m2) -> m1.getName().compareTo(m2.getName())) .collect(ImmutableList.collector()); this.validators = Collections.emptySet(); BootstrapLogger.LOG.debugv("Using Weld modules: {0}", modules.stream().map(m -> m.getName()).collect(Collectors.toList())); }
static List<StringMetadata> from(List<Metadata<String>> metadatas) { List<StringMetadata> smList = new ArrayList<>(metadatas.size()); for (Metadata<String> metadata : metadatas) { StringMetadata sm = new StringMetadata(); sm.setLocation(metadata.getLocation()); sm.setValue(metadata.getValue()); smList.add(sm); } return smList; } }