コード例 #1
0
 public void endElement(String uri, String name, String qName) {
   if (qName.equals("volumeId")) {
     if (inAttachmentSet) {
       volumeId = currentText.toString().trim();
     } else {
       id = currentText.toString().trim();
     }
   } else if (qName.equals("size")) {
     size = Integer.parseInt(currentText.toString().trim());
   } else if (qName.equals("availabilityZone")) {
     availabilityZone = currentText.toString().trim();
   } else if (qName.equals("volumeId")) {
     if (inAttachmentSet) {
       volumeId = currentText.toString().trim();
     } else {
       id = currentText.toString().trim();
     }
   } else if (qName.equals("status")) {
     if (inAttachmentSet) {
       attachmentStatus = Attachment.Status.fromValue(currentText.toString().trim());
     } else {
       volumeStatus = Volume.Status.fromValue(currentText.toString().trim());
     }
   } else if (qName.equals("createTime")) {
     createTime = dateService.iso8601DateOrSecondsDateParse(currentText.toString().trim());
   } else if (qName.equals("attachmentSet")) {
     inAttachmentSet = false;
   } else if (qName.equals("instanceId")) {
     instanceId = currentText.toString().trim();
   } else if (qName.equals("snapshotId")) {
     snapshotId = currentText.toString().trim();
     if (snapshotId.equals("")) snapshotId = null;
   } else if (qName.equals("device")) {
     device = currentText.toString().trim();
   } else if (qName.equals("attachTime")) {
     attachTime = dateService.iso8601DateOrSecondsDateParse(currentText.toString().trim());
   } else if (qName.equals("volumeType")) {
     volumeType = currentText.toString().trim();
     if (volumeType.equals("")) volumeType = null;
   } else if (qName.equals("iops")) {
     iops = Integer.parseInt(currentText.toString().trim());
   } else if (qName.equals("encrypted")) {
     encrypted = Boolean.parseBoolean(currentText.toString().trim());
   } else if (qName.equals("item")) {
     if (inAttachmentSet) {
       attachments.add(
           new Attachment(region, volumeId, instanceId, device, attachmentStatus, attachTime));
       volumeId = null;
       instanceId = null;
       device = null;
       attachmentStatus = null;
       attachTime = null;
     }
   }
   currentText.setLength(0);
 }
コード例 #2
0
 public void endElement(String uri, String name, String qName) {
   if (qName.equals("volumeId")) {
     if (inAttachmentSet) {
       volumeId = currentText.toString().trim();
     } else {
       id = currentText.toString().trim();
     }
   } else if (qName.equals("size")) {
     size = Integer.parseInt(currentText.toString().trim());
   } else if (qName.equals("availabilityZone")) {
     availabilityZone = currentText.toString().trim();
   } else if (qName.equals("volumeId")) {
     if (inAttachmentSet) {
       volumeId = currentText.toString().trim();
     } else {
       id = currentText.toString().trim();
     }
   } else if (qName.equals("status")) {
     if (inAttachmentSet) {
       attachmentStatus = Attachment.Status.fromValue(currentText.toString().trim());
     } else {
       volumeStatus = Volume.Status.fromValue(currentText.toString().trim());
     }
   } else if (qName.equals("createTime")) {
     createTime = dateCodec.toDate(currentText.toString().trim());
   } else if (qName.equals("attachmentSet")) {
     inAttachmentSet = false;
   } else if (qName.equals("instanceId")) {
     instanceId = currentText.toString().trim();
   } else if (qName.equals("snapshotId")) {
     snapshotId = currentText.toString().trim();
     if (snapshotId.equals("")) snapshotId = null;
   } else if (qName.equals("device")) {
     device = currentText.toString().trim();
   } else if (qName.equals("attachTime")) {
     attachTime = dateCodec.toDate(currentText.toString().trim());
   } else if (qName.equals("item")) {
     if (inAttachmentSet) {
       attachments.add(
           new Attachment(region, volumeId, instanceId, device, attachmentStatus, attachTime));
       volumeId = null;
       instanceId = null;
       device = null;
       attachmentStatus = null;
       attachTime = null;
     }
   }
   currentText = new StringBuilder();
 }