Package org.jboss.errai.reflections

Examples of org.jboss.errai.reflections.Reflections


* </pre>
*/
public class XmlSerializer implements Serializer {

  public Reflections read(InputStream inputStream) {
    Reflections reflections = new Reflections(new ConfigurationBuilder()) {
    };

    Document document;
    try {
      document = new SAXReader().read(inputStream);
    }
    catch (DocumentException e) {
      throw new RuntimeException(e);
    }
    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;
          Multimap<String, String> stringStringMultimap = reflections.getStore().getStoreMap().get(index.getName());
          if (stringStringMultimap == null) {
            reflections.getStore().getStoreMap().put(index.getName(),
                stringStringMultimap = HashMultimap.<String, String>create());
          }

          stringStringMultimap.put(key.getText(), value.getText());
        }
View Full Code Here


* </pre>
* */
public class XmlSerializer implements Serializer {

    public Reflections read(InputStream inputStream) {
        Reflections reflections = new Reflections(new ConfigurationBuilder()) {};

        Document document;
        try {
            document = new SAXReader().read(inputStream);
        } catch (DocumentException e) {
            throw new RuntimeException(e);
        }
        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().getStoreMap().get(index.getName()).put(key.getText(), value.getText());
                }
            }
        }

        return reflections;
View Full Code Here

        if (parallel != null && parallel.equals(Boolean.TRUE)) {
            configurationBuilder.useParallelExecutor();
        }

        Reflections reflections = new Reflections(configurationBuilder);

        for (String destination : parseDestinations()) {
            reflections.save(destination.trim());
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.errai.reflections.Reflections

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.