Example usage for org.jdom2 Element getText

List of usage examples for org.jdom2 Element getText

Introduction

In this page you can find the example usage for org.jdom2 Element getText.

Prototype

public String getText() 

Source Link

Document

Returns the textual content directly held under this element as a string.

Usage

From source file:compile.util.Pom.java

public String getParentArtifactId() {
    Element racine = _xmlUtil.getRacine();
    Element projectParent = racine.getChild("parent", null);
    Element parentArtifactId = projectParent.getChild("artifactId", null);
    return parentArtifactId.getText();
}

From source file:compile.util.Pom.java

public String getArtifactId() {
    Element racine = _xmlUtil.getRacine();
    Element projectArtifactId = racine.getChild("artifactId", null);
    return projectArtifactId.getText();
}

From source file:compile.util.Pom.java

public String getVersion() {
    Element racine = _xmlUtil.getRacine();
    Element projectVersion = racine.getChild("version", null);
    return projectVersion.getText();
}

From source file:controller.MobilePartnerController.java

public Map<String, Object> getConfiguredOverrides() throws Exception {

    Map<String, Object> configOverrides = new HashMap<>();
    SAXBuilder builder = new SAXBuilder();
    File xmlFile = new File(DIR + "\\dbconf.xml");
    Document document = (Document) builder.build(xmlFile);
    Element rootNode = document.getRootElement();

    List<Element> list = rootNode.getChildren();

    for (Element element : list) {
        configOverrides.put(element.getAttributeValue("name"), element.getText());
    }//from w ww .  j a  va2  s .  com

    return configOverrides;
}

From source file:core.xml.java

public static void extraerInformacion(List l) {
    for (int i = 0; i < l.size(); i++) {
        Element e = (Element) l.get(i);
        if (e.getChildren().size() > 0) {
            extraerInformacion(e.getChildren());
        } else if (e.getName().equals("nombre") || e.getName().equals("descripcion")
                || e.getName().equals("version")) {
            System.err.println("valor de la etiqueta : " + e.getName());
            descripcion.add(e.getText());
        } else if (e.getName().equals("columnas")) {
            num_columnas = e.getText();/*from w  w w  .  j  a va 2s .c  o  m*/
        } else if (e.getName().equals("atributo")) {
            atributos.add(e.getText());
        } else if (e.getName().equals("tipo")) {
            parametros.add(e.getText());
        } else if (e.getName().equals("columna")) {
            cabecera.add(e.getText());
        }
    }

}

From source file:count_dep.Count_dep.java

public static LinkedList<Event> ReadEvents(File f) throws JDOMException, IOException {
    LinkedList<Event> res = new LinkedList<>();
    SAXBuilder builder = new SAXBuilder();
    Document doc = builder.build(f);
    Element foo = doc.getRootElement();
    List<Element> one_document = foo.getChildren();
    for (Element one_document1 : one_document) {
        List<Element> ERE = one_document1.getChildren();
        for (Element e : ERE) {
            if ("event".equals(e.getName())) {
                List<Element> mentions = e.getChildren("event_mention");
                for (Element m : mentions) {
                    Event eve = new Event();
                    Element charseq;
                    Element ldcscpope = m.getChild("ldc_scope");
                    charseq = ldcscpope.getChild("charseq");
                    eve.span = charseq.getText().replace("\n", " ");
                    Element anchor = m.getChild("anchor");
                    charseq = anchor.getChild("charseq");
                    eve.trigger = charseq.getText();
                    if (eve.trigger.equalsIgnoreCase("saturday")) {
                        int a = 0;
                        a = a + 1;/*from w w w. j ava2s. co m*/
                    }
                    eve.eventtype = e.getAttribute("SUBTYPE").getValue();
                    eve.eventlargetype = e.getAttribute("TYPE").getValue();
                    List<Element> arguments = m.getChildren("event_mention_argument");
                    for (Element argu : arguments) {
                        String argumentstr = argu.getChild("extent").getChild("charseq").getText();
                        if ("U.S".equals(argumentstr) || "U.N".equals(argumentstr)
                                || "Feb".equals(argumentstr)) {
                            argumentstr += ".";
                        }
                        if (argumentstr.equalsIgnoreCase("Basra")) {
                            int a = 0;
                            a = a + 1;
                        }
                        eve.arguments.add(new EventArgument(argumentstr, argu.getAttributeValue("ROLE")));
                    }
                    eve.filename = f.getName();
                    res.add(eve);
                }

            }
        }
    }
    return res;
}

From source file:count_dep.Count_dep.java

public static LinkedList<Event> ReadGrishmanEvents(File f) throws JDOMException, IOException {
    LinkedList<Event> res = new LinkedList<>();
    SAXBuilder builder = new SAXBuilder();
    Document doc = builder.build(f);
    Element foo = doc.getRootElement();
    List<Element> one_document = foo.getChildren();
    for (Element one_document1 : one_document) {
        List<Element> ERE = one_document1.getChildren();
        for (Element e : ERE) {
            if ("event".equals(e.getName())) {
                List<Element> mentions = e.getChildren("event_mention");
                for (Element m : mentions) {
                    Event eve = new Event();
                    eve.filename = f.getName();
                    Element charseq;
                    Element anchor = m.getChild("anchor");
                    charseq = anchor.getChild("charseq");
                    eve.span = m.getChild("extent").getChild("charseq").getText();
                    eve.trigger = charseq.getText();
                    eve.eventtype = e.getAttribute("SUBTYPE").getValue();
                    List<Element> arguments = m.getChildren("event_mention_argument");
                    for (Element argu : arguments) {
                        eve.arguments//  ww w.ja v a  2 s.com
                                .add(new EventArgument(argu.getChild("extent").getChild("charseq").getText(),
                                        argu.getAttributeValue("ROLE")));
                    }
                    //   eve.filename = f.getName();
                    res.add(eve);
                }

            }

        }
    }
    return res;
}

From source file:cz.lbenda.dbapp.rc.db.JDBCConfiguration.java

License:Apache License

private String subElementText(Element element, String name, String def) {
    Element el = element.getChild(name);
    if (el == null) {
        return def;
    }//from  w  ww.j  av  a 2s . c om
    return el.getText();
}

From source file:cz.lbenda.dbapp.rc.SessionConfiguration.java

License:Apache License

private void fromElement(final Element element) {
    setId(element.getAttributeValue("id"));
    if (element.getChild("connectionTimeout") != null) {
        this.connectionTimeout = Integer.valueOf(element.getChildText("connectionTimeout"));
    } else {// w  ww .  ja v  a2 s . c  om
        connectionTimeout = -1;
    }
    jdbcConfigurationFromElement(element.getChild("jdbc"));
    // tableOfKeysSQLFromElement(element.getChild("tableOfKeySQLs"));
    Element ed = element.getChild("extendedDescription");
    if (ed != null) {
        setExtendedConfigurationType(ExtendedConfigurationType.valueOf(ed.getAttributeValue("type")));
        setExtendedConfigurationPath(ed.getText());
    }
    Element e = element.getChild("libraries");
    this.librariesPaths.clear();
    if (e != null) {
        for (Element lib : e.getChildren("library")) {
            this.librariesPaths.add(lib.getText());
        }
    }
    loadExtendedConfiguration();
}

From source file:cz.lbenda.dbapp.rc.SessionConfiguration.java

License:Apache License

private void tableOfKeysSQLFromElement(final Element element) {
    LOG.trace("load table of keys sql");
    if (element == null) {
        return;//from w w w  . j  a v a  2 s  .  co  m
    }
    tableOfKeysSQL.clear();
    for (Element tableOfKey : element.getChildren("tableOfKeySQL")) {
        this.tableOfKeysSQL.put(tableOfKey.getAttributeValue("id"), tableOfKey.getText());
    }
}