com.thoughtworks.xstream.io.xml.xppdom.XppDom.getValue()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中com.thoughtworks.xstream.io.xml.xppdom.XppDom.getValue()方法的一些代码示例,展示了XppDom.getValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XppDom.getValue()方法的具体详情如下:
包路径:com.thoughtworks.xstream.io.xml.xppdom.XppDom
类名称:XppDom
方法名:getValue

XppDom.getValue介绍

暂无

代码示例

代码示例来源:origin: com.thoughtworks.xstream/xstream

public String getValue() {
  String text = null;
  try {
    text = currentElement.getValue();
  } catch (Exception e) {
    // do nothing.
  }
  return text == null ? "" : text;
}

代码示例来源:origin: com.thoughtworks.xstream/xstream

if (dom1.getValue() != null || dom2.getValue() != null) {
  throw new IllegalArgumentException("XppDom cannot handle mixed mode at "
    + xpath
final String value2 = dom2.getValue();
final String value1 = dom1.getValue();
if (value1 == null) {
  s = value2 == null ? 0 : -1;

代码示例来源:origin: x-stream/xstream

@Override
public String getValue() {
  String text = null;
  try {
    text = currentElement.getValue();
  } catch (final Exception e) {
    // do nothing.
  }
  return text == null ? "" : text;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream

public String getValue() {
  String text = null;
  try {
    text = currentElement.getValue();
  } catch (Exception e) {
    // do nothing.
  }
  return text == null ? "" : text;
}

代码示例来源:origin: org.sonatype.nexus.xstream/xstream

public String getValue() {
  String text = null;
  try {
    text = currentElement.getValue();
  } catch (Exception e) {
    // do nothing.
  }
  return text == null ? "" : text;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream-java8

public String getValue() {
  String text = null;
  try {
    text = currentElement.getValue();
  } catch (Exception e) {
    // do nothing.
  }
  return text == null ? "" : text;
}

代码示例来源:origin: com.haulmont.thirdparty/xstream

public String getValue() {
  String text = null;
  try {
    text = currentElement.getValue();
  } catch (Exception e) {
    // do nothing.
  }
  return text == null ? "" : text;
}

代码示例来源:origin: apache/servicemix-bundles

public String getValue() {
  String text = null;
  try {
    text = currentElement.getValue();
  } catch (Exception e) {
    // do nothing.
  }
  return text == null ? "" : text;
}

代码示例来源:origin: x-stream/xstream

if (dom1.getValue() != null || dom2.getValue() != null) {
  throw new IllegalArgumentException("XppDom cannot handle mixed mode at " + xpath + "::text()");
final String value2 = dom2.getValue();
final String value1 = dom1.getValue();
if (value1 == null) {
  s = value2 == null ? 0 : -1;

代码示例来源:origin: org.sonatype.nexus.xstream/xstream

if (dom1.getValue() != null || dom2.getValue() != null) {
  throw new IllegalArgumentException("XppDom cannot handle mixed mode at "
    + xpath
final String value2 = dom2.getValue();
final String value1 = dom1.getValue();
if (value1 == null) {
  s = value2 == null ? 0 : -1;

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream

if (dom1.getValue() != null || dom2.getValue() != null) {
  throw new IllegalArgumentException("XppDom cannot handle mixed mode at "
    + xpath
final String value2 = dom2.getValue();
final String value1 = dom1.getValue();
if (value1 == null) {
  s = value2 == null ? 0 : -1;

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream-java8

if (dom1.getValue() != null || dom2.getValue() != null) {
  throw new IllegalArgumentException("XppDom cannot handle mixed mode at "
    + xpath
final String value2 = dom2.getValue();
final String value1 = dom1.getValue();
if (value1 == null) {
  s = value2 == null ? 0 : -1;

代码示例来源:origin: com.haulmont.thirdparty/xstream

if (dom1.getValue() != null || dom2.getValue() != null) {
  throw new IllegalArgumentException("XppDom cannot handle mixed mode at "
    + xpath
final String value2 = dom2.getValue();
final String value1 = dom1.getValue();
if (value1 == null) {
  s = value2 == null ? 0 : -1;

代码示例来源:origin: apache/servicemix-bundles

if (dom1.getValue() != null || dom2.getValue() != null) {
  throw new IllegalArgumentException("XppDom cannot handle mixed mode at "
    + xpath
final String value2 = dom2.getValue();
final String value1 = dom1.getValue();
if (value1 == null) {
  s = value2 == null ? 0 : -1;

代码示例来源:origin: senbox-org/snap-desktop

public void setGraph(final Graph graphFromFile, final boolean addUI) throws GraphException {
  if (graphFromFile != null) {
    graph = graphFromFile;
    graphNodeList.clear();
    final XppDom presentationXML = graph.getApplicationData("Presentation");
    if (presentationXML != null) {
      // get graph description
      final XppDom descXML = presentationXML.getChild("Description");
      if (descXML != null && descXML.getValue() != null) {
        graphDescription = descXML.getValue();
      }
    }
    final Node[] nodes = graph.getNodes();
    for (Node n : nodes) {
      final GraphNode newGraphNode = new GraphNode(n);
      if (presentationXML != null)
        newGraphNode.setDisplayParameters(presentationXML);
      graphNodeList.add(newGraphNode);
      if (addUI) {
        OperatorUI ui = OperatorUIRegistry.CreateOperatorUI(newGraphNode.getOperatorName());
        if (ui == null) {
          throw new GraphException("Unable to load " + newGraphNode.getOperatorName());
        }
        newGraphNode.setOperatorUI(ui);
      }
      notifyGraphEvent(new GraphEvent(events.ADD_EVENT, newGraphNode));
    }
  }
}

代码示例来源:origin: bcdev/beam

public void testReadFromXMLWithAppData() throws Exception {
  String expectedXML =
      "<graph id=\"myOneNodeGraph\">\n" +
          "  <version>1.0</version>\n" +
          "  <node id=\"node1\">\n" +
          "    <operator>Op1</operator>\n" +
          "    <sources/>\n" +
          "  </node>\n" +
          " <applicationData id=\"foo\">\n" +
          "    <font>Big</font>\n" +
          "    <colour>red</colour>\n" +
          " </applicationData>\n" +
          " <applicationData id=\"bar\">\n" +
          "    <textmode>true</textmode>\n" +
          " </applicationData>\n" +
          "</graph>";
  StringReader reader = new StringReader(expectedXML);
  Graph graph = GraphIO.read(reader);
  XppDom fooData = graph.getApplicationData("foo");
  assertNotNull(fooData);
  assertEquals(2, fooData.getChildCount());
  assertEquals("Big", fooData.getChild("font").getValue());
  assertEquals("red", fooData.getChild("colour").getValue());
  XppDom barData = graph.getApplicationData("bar");
  assertNotNull(barData);
  assertEquals(1, barData.getChildCount());
  assertEquals("true", barData.getChild("textmode").getValue());
}

代码示例来源:origin: senbox-org/snap-desktop

@Test
  public void testEscapingXmlParameters() throws Exception {
    DefaultDomElement domElement = new DefaultDomElement("parameter");
    String unescapedString = "12 < 13 && 56 > 42 & \"true\" + 'a name'";
    String escapedString = "12 &lt; 13 &amp;&amp; 56 &gt; 42 &amp; &quot;true&quot; + &apos;a name&apos;";

    domElement.addChild(new DefaultDomElement("expression", unescapedString));
    DefaultDomElement withAttribute = new DefaultDomElement("withAttribute");
    withAttribute.setAttribute("attrib", unescapedString);
    domElement.addChild(withAttribute);

    OperatorMenu.escapeXmlElements(domElement);

    assertEquals(escapedString, domElement.getChild("expression").getValue());
    assertEquals(escapedString, domElement.getChild("withAttribute").getAttribute("attrib"));

    String xmlString = domElement.toXml();
    XppDom readDomElement = OperatorMenu.createDom(xmlString);

    assertEquals(unescapedString, readDomElement.getChild("expression").getValue());
    assertEquals(unescapedString, readDomElement.getChild("withAttribute").getAttribute("attrib"));
  }
}

相关文章