package org.maskat.demo.databinding.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><myID>nttdata001</myID><myInfo>case A</myInfo></row>"
+ "  <row><name>node1</name><text>ノード1</text><parent>root</parent><myID>nttdata002</myID><myInfo>case B</myInfo></row>"
+ "  <row><name>node2</name><text>ノード2</text><parent>root</parent><myID>nttdata003</myID><myInfo>case C</myInfo></row>"
+ "  <row><name>node3</name><text>ノード3</text><parent>root</parent><myID>nttdata004</myID><myInfo>case D</myInfo></row>"
+ "  <row><name>node1_1</name><text>ノード1_1</text><parent>node1</parent><myID>nttdata005</myID><myInfo>case E</myInfo></row>"
+ "  <row><name>node1_2</name><text>ノード1_2</text><parent>node1</parent><myID>nttdata006</myID><myInfo>case F</myInfo></row>"
+ "  <row><name>node2_1</name><text>ノード2_1</text><parent>node2</parent><myID>nttdata007</myID><myInfo>case G</myInfo></row>"
+ "  <row><name>node2_2</name><text>ノード2_2</text><parent>node2</parent><myID>nttdata008</myID><myInfo>case H</myInfo></row>"
+ "  <row><name>node2_2_1</name><text>ノード2_2_1</text><parent>node2_2</parent><myID>nttdata009</myID><myInfo>case I</myInfo></row>"
+ "  <row><name>node2_2_2</name><text>ノード2_2_2</text><parent>node2_2</parent><myID>nttdata010</myID><myInfo>case J</myInfo></row>"
+ "  <row><name>node2_2_3</name><text>ノード2_2_3</text><parent>node2_2</parent><myID>nttdata011</myID><myInfo>case K</myInfo></row>"
+ "</rows></maskat>";
  }

}
