package org.maskat.demo.databinding.tr1_bt1.vo;

import java.io.BufferedReader;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import org.maskat.demo.AbstractValueObj;

public class ValueObj extends AbstractValueObj {

  public ValueObj(HttpServletRequest req) {
    super(req);

    try {
      BufferedReader reader = new BufferedReader(req.getReader());
      String line = null;
      String xml = "";
      while ((line = reader.readLine()) != null) {
        xml += line;
      }
      System.out.println(xml);
    } catch (IOException e) {
      e.printStackTrace();
      return;
    }

  }

  public String tempGetXML() {
        return "<?xml version=\"1.0\" encoding=\"UTF-8\"?><maskat><rows>"
+ "  <row><name>root</name><text>ルート</text><parent></parent></row>"
+ "  <row><name>node1</name><text>ノード1</text><parent>root</parent></row>"
+ "  <row><name>node2</name><text>ノード2</text><parent>root</parent></row>"
+ "  <row><name>node3</name><text>ノード3</text><parent>root</parent></row>"
+ "  <row><name>node1_1</name><text>ノード1_1</text><parent>node1</parent></row>"
+ "  <row><name>node1_2</name><text>ノード1_2</text><parent>node1</parent></row>"
+ "  <row><name>node2_1</name><text>ノード2_1</text><parent>node2</parent></row>"
+ "  <row><name>node2_2</name><text>ノード2_2</text><parent>node2</parent></row>"
+ "  <row><name>node2_2_1</name><text>ノード2_2_1</text><parent>node2_2</parent></row>"
+ "  <row><name>node2_2_2</name><text>ノード2_2_2</text><parent>node2_2</parent></row>"
+ "  <row><name>node2_2_3</name><text>ノード2_2_3</text><parent>node2_2</parent></row>"
+ "</rows></maskat>";
  }

}
