예제 #1
0
  private void writeComponents(BufferedWriter writer, List components) throws IOException {
    for (Iterator iterator = components.iterator(); iterator.hasNext(); ) {
      Component component = (Component) iterator.next();

      writer.write("\t<component>\n");
      writer.write("\t\t<component-type>" + component.getComponentType() + "</component-type>\n");
      writer.write(
          "\t\t<component-class>" + component.getComponentClass() + "</component-class>\n");
      writer.write("\t</component>\n");
      writer.write("\n");
    }
  }
예제 #2
0
  private void writeRenderers(BufferedWriter writer, List components) throws IOException {
    boolean writeParentTag = true;
    for (Iterator iterator = components.iterator(); iterator.hasNext(); ) {
      Component component = (Component) iterator.next();

      if (component.getRendererType() == null) {
        continue;
      } else if (writeParentTag) {
        writer.write("\t<render-kit>\n");
        writeParentTag = false;
      }

      writer.write("\t\t<renderer>\n");
      writer.write(
          "\t\t\t<component-family>" + component.getComponentFamily() + "</component-family>\n");
      writer.write("\t\t\t<renderer-type>" + component.getRendererType() + "</renderer-type>\n");
      writer.write("\t\t\t<renderer-class>" + component.getRendererClass() + "</renderer-class>\n");
      writer.write("\t\t</renderer>\n");
    }

    if (!writeParentTag) {
      writer.write("\t</render-kit>\n\n");
    }
  }