Examples of childElementCursor()


Examples of org.codehaus.staxmate.in.SMHierarchicCursor.childElementCursor()

      SMInputFactory inputFactory = initStax();
      SMHierarchicCursor cursor = inputFactory.rootElementCursor(xml);

      // advance to <sqale>
      cursor.advance();
      SMInputCursor chcCursor = cursor.childElementCursor(CHARACTERISTIC);

      while (chcCursor.getNext() != null) {
        process(debtModel, null, chcCursor);
      }
View Full Code Here

Examples of org.codehaus.staxmate.in.SMHierarchicCursor.childElementCursor()

      SMInputFactory inputFactory = initStax();
      SMHierarchicCursor cursor = inputFactory.rootElementCursor(xml);

      // advance to <sqale>
      cursor.advance();
      SMInputCursor rootCursor = cursor.childElementCursor(CHARACTERISTIC);
      while (rootCursor.getNext() != null) {
        process(ruleDebts, null, null, validationMessages, rootCursor);
      }

      cursor.getStreamReader().closeCompletely();
View Full Code Here

Examples of org.codehaus.staxmate.in.SMHierarchicCursor.childElementCursor()

  private void writeFromTestData(String data, JsonWriter json) {
    SMInputFactory inputFactory = initStax();
    try {
      SMHierarchicCursor root = inputFactory.rootElementCursor(new StringReader(data));
      root.advance(); // tests-details
      SMInputCursor cursor = root.childElementCursor();
      json.name("tests").beginArray();
      while (cursor.getNext() != null) {
        json.beginObject();

        json.prop("name", cursor.getAttrValue("name"));
View Full Code Here

Examples of org.codehaus.staxmate.in.SMHierarchicCursor.childElementCursor()

      SMHierarchicCursor rootC = inputFactory.rootElementCursor(reader);
      rootC.advance(); // <profile>
      if (!rootC.getLocalName().equals("profile")) {
        throw new IllegalArgumentException("Backup XML is not valid. Root element must be <profile>.");
      }
      SMInputCursor cursor = rootC.childElementCursor();
      while (cursor.getNext() != null) {
        String nodeName = cursor.getLocalName();
        if (StringUtils.equals("name", nodeName)) {
          profileName = StringUtils.trim(cursor.collectDescendantText(false));
View Full Code Here

Examples of org.codehaus.staxmate.in.SMHierarchicCursor.childElementCursor()

    try {
      SMHierarchicCursor rootC = inputFactory.rootElementCursor(reader);
      rootC.advance(); // <rules>
      List<Rule> rules = new ArrayList<Rule>();

      SMInputCursor rulesC = rootC.childElementCursor("rule");
      while (rulesC.getNext() != null) {
        // <rule>
        Rule rule = Rule.create();
        rules.add(rule);
View Full Code Here

Examples of org.codehaus.staxmate.in.SMHierarchicCursor.childElementCursor()

    if (duplicationsData != null) {
      try {
        SMInputFactory inputFactory = initStax();
        SMHierarchicCursor root = inputFactory.rootElementCursor(new StringReader(duplicationsData));
        root.advance(); // <duplications>
        SMInputCursor cursor = root.childElementCursor("g");
        while (cursor.getNext() != null) {
          List<Duplication> duplications = newArrayList();
          SMInputCursor bCursor = cursor.childElementCursor("b");
          while (bCursor.getNext() != null) {
            String from = bCursor.getAttrValue("s");
View Full Code Here

Examples of org.codehaus.staxmate.in.SMHierarchicCursor.childElementCursor()

    RulesProfile profile = RulesProfile.create();
    SMInputFactory inputFactory = initStax();
    try {
      SMHierarchicCursor rootC = inputFactory.rootElementCursor(reader);
      rootC.advance(); // <profile>
      SMInputCursor cursor = rootC.childElementCursor();
      while (cursor.getNext() != null) {
        String nodeName = cursor.getLocalName();
        if (StringUtils.equals("rules", nodeName)) {
          SMInputCursor rulesCursor = cursor.childElementCursor("rule");
          processRules(rulesCursor, profile, messages);
View Full Code Here

Examples of org.codehaus.staxmate.in.SMHierarchicCursor.childElementCursor()

    SMInputFactory inputFactory = new SMInputFactory(xmlFactory);
    try {
      SMHierarchicCursor rootC = inputFactory.rootElementCursor(reader);
      rootC.advance(); // <rules>

      SMInputCursor rulesC = rootC.childElementCursor("rule");
      while (rulesC.getNext() != null) {
        // <rule>
        processRule(repo, rulesC);
      }
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor.childElementCursor()

    assertGotNextElementNamed(b_iterator,"A1B1");

    // Edge case 1...
    // Get child cursor but leave in State.INITIAL...
    // Skip tree needs to start with initial depth value of 0...
    b_iterator.childElementCursor();
   
    assertGotNextElementNamed(b_iterator,"A1B2");
    assertNull(b_iterator.getNext());

    assertNull(a_iterator.getNext());
View Full Code Here

Examples of org.codehaus.staxmate.in.SMInputCursor.childElementCursor()

    while (child.getNext() != null) {
      String tagName = child.getLocalName();
      if ("kind".equalsIgnoreCase(tagName)) {
        kind = child.getElemStringValue();
      } else if ("xwhat".equalsIgnoreCase(tagName)) {
        text = child.childElementCursor("text").advance().getElemStringValue();
      } else if ("what".equalsIgnoreCase(tagName)) {
        text = child.getElemStringValue();
      } else if ("stack".equalsIgnoreCase(tagName)) {
        stack = parseStackTag(child);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.