コード例 #1
0
 @Override
 public void startElement(String uri, String localName, String element_name, Attributes attributes)
     throws SAXException {
   buffer = new StringBuffer();
   if (element_name.equals(IExchangeFieldNames.ITEM)) {
     if (ITableTypes.EXPORTTEMPLATE.equals(attributes.getValue("type"))) {
       tmpExportTemplateBean = new TExportTemplateBean();
       tmpExportTemplateBean.setObjectID(
           Integer.parseInt(attributes.getValue(IExchangeFieldNames.OBJECT_ID)));
       tmpExportTemplateBean.setUuid(attributes.getValue(IExchangeFieldNames.TPUUID));
       isExportTemplate = true;
       isSub = false;
     } else {
       isSub = true;
     }
   }
   if (isExportTemplate && !isSub) {
     if (element_name.equals(IExchangeFieldNames.NAME)) {
       isName = true;
     } else if (element_name.equals(IExchangeFieldNames.REPORTTYPE)) {
       isReportType = true;
     } else if (element_name.equals(IExchangeFieldNames.EXPORTFORMAT)) {
       isExportFormat = true;
     } else if (element_name.equals(IExchangeFieldNames.REPOSITORYTYPE)) {
       isRepositoryType = true;
     } else if (element_name.equals(IExchangeFieldNames.DESCRIPTION)) {
       isDescription = true;
     } else if (element_name.equals(IExchangeFieldNames.PROJECT)) {
       isProject = true;
     } else if (element_name.equals(IExchangeFieldNames.PERSON)) {
       isPerson = true;
     } else if (element_name.equals(IExchangeFieldNames.CATEGORYKEY)) {
       isCategoryKey = true;
     } else if (element_name.equals(IExchangeFieldNames.DELETED)) {
       isDeleted = true;
     }
   }
 }
コード例 #2
0
  @Override
  public void endElement(String uri, String localName, String element_name) throws SAXException {

    if (element_name.equals(IExchangeFieldNames.ITEM) && isExportTemplate) {
      exportTemplateBeans.add(tmpExportTemplateBean);
      isExportTemplate = false;
    }
    if (!isSub && isExportTemplate) {
      if (element_name.equals(IExchangeFieldNames.NAME)) {
        tmpExportTemplateBean.setName(buffer.toString());
        isName = false;
      } else if (element_name.equals(IExchangeFieldNames.REPORTTYPE)) {
        tmpExportTemplateBean.setReportType(buffer.toString());
        isReportType = false;
      } else if (element_name.equals(IExchangeFieldNames.EXPORTFORMAT)) {
        tmpExportTemplateBean.setExportFormat(buffer.toString());
        isExportFormat = false;
      } else if (element_name.equals(IExchangeFieldNames.REPOSITORYTYPE)) {
        tmpExportTemplateBean.setRepositoryType(Integer.parseInt(buffer.toString()));
        isRepositoryType = false;
      } else if (element_name.equals(IExchangeFieldNames.DESCRIPTION)) {
        tmpExportTemplateBean.setDescription(buffer.toString());
        isDescription = false;
      } else if (element_name.equals(IExchangeFieldNames.PROJECT)) {
        tmpExportTemplateBean.setProject(Integer.parseInt(buffer.toString()));
        isProject = false;
      } else if (element_name.equals(IExchangeFieldNames.PERSON)) {
        tmpExportTemplateBean.setPerson(Integer.parseInt(buffer.toString()));
        isPerson = false;
      } else if (element_name.equals(IExchangeFieldNames.CATEGORYKEY)) {
        tmpExportTemplateBean.setCategoryKey(Integer.parseInt(buffer.toString()));
        isCategoryKey = false;
      } else if (element_name.equals(IExchangeFieldNames.DELETED)) {
        tmpExportTemplateBean.setDeleted(buffer.toString());
        isDeleted = false;
      }
    }
  }