public void endElement()

in rds/src/main/java/org/jclouds/rds/xml/InstanceHandler.java [91:146]


   public void endElement(String uri, String name, String qName) throws SAXException {

      if (equalsOrSuffix(qName, "DBSubnetGroup")) {
         builder.subnetGroup(subnetGroupHandler.getResult());
         inSubnetGroup = false;
      } else if (inSubnetGroup) {
         subnetGroupHandler.endElement(uri, name, qName);
      } else if (equalsOrSuffix(qName, "DBInstanceIdentifier")) {
         builder.id(currentOrNull(currentText));
      } else if (equalsOrSuffix(qName, "InstanceCreateTime")) {
         builder.createdTime(dateService.iso8601DateParse(currentOrNull(currentText)));
      } else if (equalsOrSuffix(qName, "DBName")) {
         builder.name(currentOrNull(currentText));
      } else if (equalsOrSuffix(qName, "AllocatedStorage")) {
         builder.allocatedStorageGB(Integer.parseInt(currentOrNull(currentText)));
      } else if (equalsOrSuffix(qName, "DBInstanceStatus")) {
         String rawStatus = currentOrNull(currentText);
         builder.rawStatus(rawStatus);
         builder.status(Instance.Status.fromValue(rawStatus));
      } else if (equalsOrSuffix(qName, "Address")) {
         address = currentOrNull(currentText);
      } else if (equalsOrSuffix(qName, "Port")) {
         port = Integer.valueOf(currentOrNull(currentText));
      } else if (equalsOrSuffix(qName, "Endpoint")) {
         // sometimes in deleting state, address is null while port isn't
         if (address != null && port != null)
            builder.endpoint(HostAndPort.fromParts(address, port));
         address = null;
         port = null;
      } else if (equalsOrSuffix(qName, "DBSecurityGroupName")) {
         groupName = currentOrNull(currentText);
      } else if (equalsOrSuffix(qName, "Status")) {
         status = currentOrNull(currentText);
      } else if (equalsOrSuffix(qName, "DBSecurityGroup")) {
         securityGroupBuilder.put(groupName, status);
         groupName = status = null;
      } else if (equalsOrSuffix(qName, "DBSecurityGroups")) {
         builder.securityGroupNameToStatus(securityGroupBuilder.build());
         securityGroupBuilder = ImmutableMap.<String, String> builder();
      } else if (equalsOrSuffix(qName, "DBInstanceClass")) {
         builder.instanceClass(currentOrNull(currentText));
      } else if (equalsOrSuffix(qName, "AvailabilityZone")) {
         builder.availabilityZone(currentOrNull(currentText));
      } else if (equalsOrSuffix(qName, "MultiAZ")) {
         builder.multiAZ(Boolean.parseBoolean(currentOrNull(currentText)));
      } else if (equalsOrSuffix(qName, "Engine")) {
         builder.engine(currentOrNull(currentText));
      } else if (equalsOrSuffix(qName, "EngineVersion")) {
         builder.engineVersion(currentOrNull(currentText));
      } else if (equalsOrSuffix(qName, "LicenseModel")) {
         builder.licenseModel(currentOrNull(currentText));
      } else if (equalsOrSuffix(qName, "MasterUsername")) {
         builder.masterUsername(currentOrNull(currentText));
      }
      currentText.setLength(0);
   }