Search in sources :

Example 16 with Namespace

use of org.jdom2.Namespace in project JMRI by JMRI.

the class LocaleSelectorTest method testFindPartialCodeNoAttribute.

public void testFindPartialCodeNoAttribute() {
    LocaleSelector.suffixes = new String[] { "kl_KL", "kl" };
    Namespace xml = Namespace.XML_NAMESPACE;
    Element el = new Element("foo").addContent(new Element("temp").setAttribute("lang", "aa_BB", xml).addContent("b")).addContent(new Element("temp").setAttribute("lang", "kl", xml).addContent("c")).addContent(new Element("temp").setAttribute("lang", "kl_AA", xml).addContent("d"));
    String result = LocaleSelector.getAttribute(el, "temp");
    Assert.assertEquals("find default", "c", result);
}
Also used : Element(org.jdom2.Element) Namespace(org.jdom2.Namespace)

Example 17 with Namespace

use of org.jdom2.Namespace in project JMRI by JMRI.

the class LocaleSelectorTest method testFindFullCodeNoAttribute.

public void testFindFullCodeNoAttribute() {
    LocaleSelector.suffixes = new String[] { "kl_KL", "kl" };
    Namespace xml = Namespace.XML_NAMESPACE;
    Element el = new Element("foo").addContent(new Element("temp").setAttribute("lang", "aa_BB", xml).addContent("b")).addContent(new Element("temp").setAttribute("lang", "kl", xml).addContent("b")).addContent(new Element("temp").setAttribute("lang", "kl_KL", xml).addContent("c"));
    String result = LocaleSelector.getAttribute(el, "temp");
    Assert.assertEquals("find default", "c", result);
}
Also used : Element(org.jdom2.Element) Namespace(org.jdom2.Namespace)

Example 18 with Namespace

use of org.jdom2.Namespace in project JMRI by JMRI.

the class LocaleSelectorTest method testFindDefault.

public void testFindDefault() {
    LocaleSelector.suffixes = new String[] { "kl_KL", "kl" };
    Namespace xml = Namespace.XML_NAMESPACE;
    Element el = new Element("foo").setAttribute("temp", "a").addContent(new Element("temp").setAttribute("lang", "hh", xml).addContent("b"));
    String result = LocaleSelector.getAttribute(el, "temp");
    Assert.assertEquals("find default", "a", result);
}
Also used : Element(org.jdom2.Element) Namespace(org.jdom2.Namespace)

Example 19 with Namespace

use of org.jdom2.Namespace in project JMRI by JMRI.

the class RevHistoryXml method loadRevHistory.

public static RevHistory loadRevHistory(Element e) {
    RevHistory r = new RevHistory();
    java.util.List<Element> list = e.getChildren("revision", Namespace.getNamespace(NAMESPACE));
    for (int i = 0; i < list.size(); i++) {
        loadRevision(r, list.get(i));
    }
    return r;
}
Also used : Element(org.jdom2.Element) RevHistory(jmri.util.docbook.RevHistory)

Example 20 with Namespace

use of org.jdom2.Namespace in project JMRI by JMRI.

the class RevHistoryXml method historyElement.

static Element historyElement(RevHistory r) {
    ArrayList<Revision> list = r.getList();
    Element e = new Element("revhistory", NAMESPACE);
    for (int i = 0; i < list.size(); i++) {
        Element revision = revisionElement(list.get(i));
        e.addContent(revision);
    }
    return e;
}
Also used : Revision(jmri.util.docbook.Revision) Element(org.jdom2.Element)

Aggregations

Element (org.jdom2.Element)31 Namespace (org.jdom2.Namespace)17 ProcessModel (de.hpi.bpt.scylla.model.process.ProcessModel)11 ScyllaValidationException (de.hpi.bpt.scylla.exception.ScyllaValidationException)10 HashMap (java.util.HashMap)9 JDOMException (org.jdom2.JDOMException)5 ArrayList (java.util.ArrayList)4 List (java.util.List)4 Map (java.util.Map)4 BranchingBehavior (de.hpi.bpt.scylla.model.configuration.BranchingBehavior)3 TimeDistributionWrapper (de.hpi.bpt.scylla.model.configuration.distribution.TimeDistributionWrapper)3 NodeNotFoundException (de.hpi.bpt.scylla.model.process.graph.exception.NodeNotFoundException)3 SimulationConfiguration (de.hpi.bpt.scylla.model.configuration.SimulationConfiguration)2 Distribution (de.hpi.bpt.scylla.model.configuration.distribution.Distribution)2 Resource (de.hpi.bpt.scylla.model.global.resource.Resource)2 CommonProcessElements (de.hpi.bpt.scylla.model.process.CommonProcessElements)2 Graph (de.hpi.bpt.scylla.model.process.graph.Graph)2 MultipleStartNodesException (de.hpi.bpt.scylla.model.process.graph.exception.MultipleStartNodesException)2 NoStartNodeException (de.hpi.bpt.scylla.model.process.graph.exception.NoStartNodeException)2 DataObjectType (de.hpi.bpt.scylla.model.process.node.DataObjectType)2