/** * merges a Reflections instance metadata into this instance */ public Reflections merge(final Reflections reflections) { if (reflections.store != null) { for (String indexName : reflections.store.keySet()) { Multimap<String, String> index = reflections.store.get(indexName); for (String key : index.keySet()) { for (String string : index.get(key)) { store.getOrCreate(indexName).put(key, string); } } } } return this; }
/** * merges a Reflections instance metadata into this instance */ public Reflections merge(final Reflections reflections) { if (reflections.store != null) { for (String indexName : reflections.store.keySet()) { Multimap<String, String> index = reflections.store.get(indexName); for (String key : index.keySet()) { for (String string : index.get(key)) { store.getOrCreate(indexName).put(key, string); } } } } return this; }
public Reflections read(InputStream inputStream) { Reflections reflections; try { Constructor<Reflections> constructor = Reflections.class.getDeclaredConstructor(); constructor.setAccessible(true); reflections = constructor.newInstance(); } catch (Exception e) { reflections = new Reflections(new ConfigurationBuilder()); } try { Document document = new SAXReader().read(inputStream); for (Object e1 : document.getRootElement().elements()) { Element index = (Element) e1; for (Object e2 : index.elements()) { Element entry = (Element) e2; Element key = entry.element("key"); Element values = entry.element("values"); for (Object o3 : values.elements()) { Element value = (Element) o3; reflections.getStore().getOrCreate(index.getName()).put(key.getText(), value.getText()); } } } } catch (DocumentException e) { throw new ReflectionsException("could not read.", e); } catch (Throwable e) { throw new RuntimeException("Could not read. Make sure relevant dependencies exist on classpath.", e); } return reflections; }
public Reflections read(InputStream inputStream) { Reflections reflections; try { Constructor<Reflections> constructor = Reflections.class.getDeclaredConstructor(); constructor.setAccessible(true); reflections = constructor.newInstance(); } catch (Exception e) { reflections = new Reflections(new ConfigurationBuilder()); } try { Document document = new SAXReader().read(inputStream); for (Object e1 : document.getRootElement().elements()) { Element index = (Element) e1; for (Object e2 : index.elements()) { Element entry = (Element) e2; Element key = entry.element("key"); Element values = entry.element("values"); for (Object o3 : values.elements()) { Element value = (Element) o3; reflections.getStore().getOrCreate(index.getName()).put(key.getText(), value.getText()); } } } } catch (DocumentException e) { throw new ReflectionsException("could not read.", e); } catch (Throwable e) { throw new RuntimeException("Could not read. Make sure relevant dependencies exist on classpath.", e); } return reflections; }
/** * constructs a Reflections instance and scan according to given {@link org.reflections.Configuration} * <p>it is preferred to use {@link org.reflections.util.ConfigurationBuilder} */ public Reflections(final Configuration configuration) { this.configuration = configuration; store = new Store(configuration); if (configuration.getScanners() != null && !configuration.getScanners().isEmpty()) { //inject to scanners for (Scanner scanner : configuration.getScanners()) { scanner.setConfiguration(configuration); scanner.setStore(store.getOrCreate(scanner.getClass().getSimpleName())); } scan(); if (configuration.shouldExpandSuperTypes()) { expandSuperTypes(); } } }
/** * constructs a Reflections instance and scan according to given {@link org.reflections.Configuration} * <p>it is preferred to use {@link org.reflections.util.ConfigurationBuilder} */ public Reflections(final Configuration configuration) { this.configuration = configuration; store = new Store(configuration); if (configuration.getScanners() != null && !configuration.getScanners().isEmpty()) { //inject to scanners for (Scanner scanner : configuration.getScanners()) { scanner.setConfiguration(configuration); scanner.setStore(store.getOrCreate(index(scanner.getClass()))); } scan(); if (configuration.shouldExpandSuperTypes()) { expandSuperTypes(); } } }
/** * merges a Reflections instance metadata into this instance */ public Reflections merge(final Reflections reflections) { if (reflections.store != null) { for (String indexName : reflections.store.keySet()) { Multimap<String, String> index = reflections.store.get(indexName); for (String key : index.keySet()) { for (String string : index.get(key)) { store.getOrCreate(indexName).put(key, string); } } } } return this; }
/** * merges a Reflections instance metadata into this instance */ public Reflections merge(final Reflections reflections) { if (reflections.store != null) { for (String indexName : reflections.store.keySet()) { Multimap<String, String> index = reflections.store.get(indexName); for (String key : index.keySet()) { for (String string : index.get(key)) { store.getOrCreate(indexName).put(key, string); } } } } return this; }
public Reflections read(InputStream inputStream) { Reflections reflections; try { Constructor<Reflections> constructor = Reflections.class.getDeclaredConstructor(); constructor.setAccessible(true); reflections = constructor.newInstance(); } catch (Exception e) { reflections = new Reflections(new ConfigurationBuilder()); } try { Document document = new SAXReader().read(inputStream); for (Object e1 : document.getRootElement().elements()) { Element index = (Element) e1; for (Object e2 : index.elements()) { Element entry = (Element) e2; Element key = entry.element("key"); Element values = entry.element("values"); for (Object o3 : values.elements()) { Element value = (Element) o3; reflections.getStore().getOrCreate(index.getName()).put(key.getText(), value.getText()); } } } } catch (DocumentException e) { throw new ReflectionsException("could not read.", e); } catch (Throwable e) { throw new RuntimeException("Could not read. Make sure relevant dependencies exist on classpath.", e); } return reflections; }
public Reflections read(InputStream inputStream) { Reflections reflections; try { Constructor<Reflections> constructor = Reflections.class.getDeclaredConstructor(); constructor.setAccessible(true); reflections = constructor.newInstance(); } catch (Exception e) { reflections = new Reflections(new ConfigurationBuilder()); } try { Document document = new SAXReader().read(inputStream); for (Object e1 : document.getRootElement().elements()) { Element index = (Element) e1; for (Object e2 : index.elements()) { Element entry = (Element) e2; Element key = entry.element("key"); Element values = entry.element("values"); for (Object o3 : values.elements()) { Element value = (Element) o3; reflections.getStore().getOrCreate(index.getName()).put(key.getText(), value.getText()); } } } } catch (DocumentException e) { throw new ReflectionsException("could not read.", e); } catch (Throwable e) { throw new RuntimeException("Could not read. Make sure relevant dependencies exist on classpath.", e); } return reflections; }
public Reflections read(InputStream inputStream) { Reflections reflections; try { Constructor<Reflections> constructor = Reflections.class.getDeclaredConstructor(); constructor.setAccessible(true); reflections = constructor.newInstance(); } catch (Exception e) { reflections = new Reflections(new ConfigurationBuilder()); } try { Document document = new SAXReader().read(inputStream); for (Object e1 : document.getRootElement().elements()) { Element index = (Element) e1; for (Object e2 : index.elements()) { Element entry = (Element) e2; Element key = entry.element("key"); Element values = entry.element("values"); for (Object o3 : values.elements()) { Element value = (Element) o3; reflections.getStore().getOrCreate(index.getName()).put(key.getText() , value.getText()); } } } } catch (DocumentException e) { throw new ReflectionsException("could not read." , e); } catch (Throwable e) { throw new RuntimeException("Could not read. Make sure relevant dependencies exist on classpath." , e); } return reflections; }
/** * constructs a Reflections instance and scan according to given {@link org.reflections.Configuration} * <p>it is preferred to use {@link org.reflections.util.ConfigurationBuilder} */ public Reflections(final Configuration configuration) { this.configuration = configuration; store = new Store(configuration); if (configuration.getScanners() != null && !configuration.getScanners().isEmpty()) { //inject to scanners for (Scanner scanner : configuration.getScanners()) { scanner.setConfiguration(configuration); scanner.setStore(store.getOrCreate(scanner.getClass().getSimpleName())); } scan(); } }
public Reflections(final Configuration configuration) { this.configuration = configuration; store = new Store(configuration); if (configuration.getScanners() != null && ! configuration.getScanners().isEmpty()) { //inject to scanners for (Scanner scanner : configuration.getScanners()) { scanner.setConfiguration(configuration); scanner.setStore(store.getOrCreate(scanner.getClass().getSimpleName())); } scan(); if (configuration.shouldExpandSuperTypes()) { expandSuperTypes(); } } }
public Reflections merge(final Reflections reflections) { if (reflections.store != null) { for (String indexName : reflections.store.keySet()) { Multimap<String, String> index = reflections.store.get(indexName); for (String key : index.keySet()) { for (String string : index.get(key)) { store.getOrCreate(indexName).put(key , string); } } } } return this; }
/** * constructs a Reflections instance and scan according to given {@link org.reflections.Configuration} * <p>it is preferred to use {@link org.reflections.util.ConfigurationBuilder} */ public Reflections(final Configuration configuration) { this.configuration = configuration; store = new Store(configuration); if (configuration.getScanners() != null && !configuration.getScanners().isEmpty()) { //inject to scanners for (Scanner scanner : configuration.getScanners()) { scanner.setConfiguration(configuration); scanner.setStore(store.getOrCreate(scanner.getClass().getSimpleName())); } scan(); if (configuration.shouldExpandSuperTypes()) { expandSuperTypes(); } } }