Package org.eweb4j.util.xml

Examples of org.eweb4j.util.xml.XMLWriter


  }

  public static void createStartXml(String path, ConfigBean cb)
      throws Exception {
    XMLWriter writer = BeanXMLUtil.getBeanXMLWriter(new File(path), cb);
    writer.setBeanName("eweb4j");
    writer.setClass("eweb4j", ConfigBean.class);
    writer.write();
  }
View Full Code Here


        // 重写配置文件
        try {
          // 保存为备份文件
          FileUtil.copy(file, new File(startXmlPath + ".back" + "_"
              + StringUtil.getNowTime("MMddHHmmss")));
          XMLWriter writer = BeanXMLUtil.getBeanXMLWriter(file,ConfigBeanCreator.getConfigBean());
          writer.setBeanName("eweb4j");
          writer.setClass("eweb4j", ConfigBean.class);
          writer.write();
          String info = "configuration error, now it has repaired.";
          error = StringUtil.getNowTime() + "EWeb4JConfig : " + info
              + "exception:" + StringUtil.getExceptionString(e);

          log.error(info);
View Full Code Here

    return error;
  }

  public static void createStartXml(String path, ConfigBean cb)
      throws Exception {
    XMLWriter writer = BeanXMLUtil.getBeanXMLWriter(new File(path), cb);
    writer.setBeanName("eweb4j");
    writer.setClass("eweb4j", ConfigBean.class);
    writer.write();
  }
View Full Code Here

  protected void renderXML(Object obj) {
    try {
      Class<?> cls = obj.getClass();

      XMLWriter writer = BeanXMLUtil.getBeanXMLWriter(obj);
      writer.setSubNameAuto(true);
      writer.setClass(cls);
      writer.setRootElementName(null);
      this.context.getResponse().setContentType(MIMEType.XML);
      this.context.getWriter().print(writer.toXml());
      this.context.getWriter().flush();
    } catch (Exception e) {
    }
  }
View Full Code Here

      // 保存为备份文件
      File tf = new File(configFile.getAbsolutePath() + ".back" + StringUtil.getNowTime("_MMddHHmmss"));
      FileUtil.copy(configFile, tf);
      log.debug("backup file->" + tf.getAbsolutePath());

      XMLWriter writer = BeanXMLUtil.getBeanXMLWriter(configFile, DAOConfigBeanCreator.getDAOBean());
      writer.setBeanName("dataSource");
      writer.setClass("dataSource", DBInfoConfigBean.class);
      writer.write();

      StringBuilder tsb = new StringBuilder(ConfigInfoCons.REPAIR_CONFIG_FILE);
      tsb.append(err);
      error = tsb.toString();
View Full Code Here

      // 保存为备份文件
      File tf = new File(configFile.getAbsolutePath() + ".back" + StringUtil.getNowTime("_MMddHHmmss"));
      FileUtil.copy(configFile, tf);
      log.debug("backup file ->" + tf.getAbsolutePath());

      XMLWriter writer = BeanXMLUtil.getBeanXMLWriter(configFile, IOCConfigBeanCreator.getIOCBean());
      writer.setBeanName("ioc");
      writer.setClass("ioc", IOCConfigBean.class);
      writer.write();

      StringBuilder sb = new StringBuilder(ConfigInfoCons.REPAIR_FILE);

      sb.append(error);
View Full Code Here

TOP

Related Classes of org.eweb4j.util.xml.XMLWriter

Copyright © 2018 www.massapicom. 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.