< prev index next >

make/jdk/src/classes/build/tools/jdwpgen/AbstractTypeListNode.java

Print this page




  23  * questions.
  24  */
  25 
  26 package build.tools.jdwpgen;
  27 
  28 import java.util.*;
  29 import java.io.*;
  30 
  31 abstract class AbstractTypeListNode extends AbstractNamedNode {
  32 
  33     void constrainComponent(Context ctx, Node node) {
  34         if (node instanceof TypeNode) {
  35             node.constrain(ctx);
  36         } else {
  37             error("Expected type descriptor item, got: " + node);
  38         }
  39     }
  40 
  41     void document(PrintWriter writer) {
  42         writer.println("<dt>" + name() + " Data");
  43         writer.println("<dd>");
  44         if (components.isEmpty()) {
  45             writer.println("(None)");
  46         } else {
  47             writer.println("<table><tr>");
  48             writer.println("<th class=\"bold\" style=\"width: 20%\" scope=\"col\">Type");
  49             writer.println("<th class=\"bold\" style=\"width: 15%\" scope=\"col\">Name");
  50             writer.println("<th class=\"bold\" style=\"width: 65%\" scope=\"col\">Description");
  51             writer.println("</tr>");

  52             for (Node node : components) {
  53                 node.document(writer);
  54             }
  55             writer.println("</table>");
  56         }
  57         writer.println("</dd>");
  58     }
  59 
  60     void genJavaClassBodyComponents(PrintWriter writer, int depth) {
  61         for (Node node : components) {
  62             TypeNode tn = (TypeNode)node;
  63 
  64             tn.genJavaDeclaration(writer, depth);
  65         }
  66     }
  67 
  68     void genJavaReads(PrintWriter writer, int depth) {
  69         for (Node node : components) {
  70             TypeNode tn = (TypeNode)node;
  71             tn.genJavaRead(writer, depth, tn.name());
  72         }
  73     }
  74 
  75     void genJavaReadingClassBody(PrintWriter writer, int depth,
  76                                  String className) {
  77         genJavaClassBodyComponents(writer, depth);




  23  * questions.
  24  */
  25 
  26 package build.tools.jdwpgen;
  27 
  28 import java.util.*;
  29 import java.io.*;
  30 
  31 abstract class AbstractTypeListNode extends AbstractNamedNode {
  32 
  33     void constrainComponent(Context ctx, Node node) {
  34         if (node instanceof TypeNode) {
  35             node.constrain(ctx);
  36         } else {
  37             error("Expected type descriptor item, got: " + node);
  38         }
  39     }
  40 
  41     void document(PrintWriter writer) {
  42         writer.println("<dt>" + name() + " Data");

  43         if (components.isEmpty()) {
  44             writer.println("<dd>(None)");
  45         } else {
  46             writer.println("<dd><table><tr>");
  47             for (int i = maxStructIndent; i > 0; --i) {
  48                 writer.print("<th style=\"width: 4%\">");
  49             }
  50             writer.println("<th style=\"width: 15%\"><th style=\"width: 65%\">");
  51             writer.println("");
  52             for (Node node : components) {
  53                 node.document(writer);
  54             }
  55             writer.println("</table>");
  56         }

  57     }
  58 
  59     void genJavaClassBodyComponents(PrintWriter writer, int depth) {
  60         for (Node node : components) {
  61             TypeNode tn = (TypeNode)node;
  62 
  63             tn.genJavaDeclaration(writer, depth);
  64         }
  65     }
  66 
  67     void genJavaReads(PrintWriter writer, int depth) {
  68         for (Node node : components) {
  69             TypeNode tn = (TypeNode)node;
  70             tn.genJavaRead(writer, depth, tn.name());
  71         }
  72     }
  73 
  74     void genJavaReadingClassBody(PrintWriter writer, int depth,
  75                                  String className) {
  76         genJavaClassBodyComponents(writer, depth);


< prev index next >