/** * {@inheritDoc} */ @Override public void endElement(String uri, String name, String qName) throws SAXException { if (equalsOrSuffix(qName, "ipProtocol")) { // Algorete: ipProtocol can be an empty tag on EC2 clone (e.g. // OpenStack EC2) builder.ipProtocol(IpProtocol.fromValue(currentOrNegative(currentText))); } else if (equalsOrSuffix(qName, "fromPort")) { // Algorete: fromPort can be an empty tag on EC2 clone (e.g. OpenStack // EC2) builder.fromPort(Integer.parseInt(currentOrNegative(currentText))); } else if (equalsOrSuffix(qName, "toPort")) { // Algorete: toPort can be an empty tag on EC2 clone (e.g. OpenStack // EC2) builder.toPort(Integer.parseInt(currentOrNegative(currentText))); } else if (equalsOrSuffix(qName, "cidrIp")) { builder.ipRange(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "userId")) { this.userId = currentOrNull(currentText); } else if (equalsOrSuffix(qName, "groupName") || equalsOrSuffix(qName, "groupId")) { this.groupId = currentOrNull(currentText); } else if (equalsOrSuffix(qName, "item")) { if (userId != null && groupId != null) builder.userIdGroupPair(userId, groupId); userId = groupId = null; } currentText = new StringBuilder(); }
/** * {@inheritDoc} */ @Override public void endElement(String uri, String name, String qName) throws SAXException { if (equalsOrSuffix(qName, "ipProtocol")) { // Algorete: ipProtocol can be an empty tag on EC2 clone (e.g. // OpenStack EC2) builder.ipProtocol(IpProtocol.fromValue(currentOrNegative(currentText))); } else if (equalsOrSuffix(qName, "fromPort")) { // Algorete: fromPort can be an empty tag on EC2 clone (e.g. OpenStack // EC2) builder.fromPort(Integer.parseInt(currentOrNegative(currentText))); } else if (equalsOrSuffix(qName, "toPort")) { // Algorete: toPort can be an empty tag on EC2 clone (e.g. OpenStack // EC2) builder.toPort(Integer.parseInt(currentOrNegative(currentText))); } else if (equalsOrSuffix(qName, "cidrIp")) { builder.ipRange(currentOrNull(currentText)); } else if (equalsOrSuffix(qName, "userId")) { this.userId = currentOrNull(currentText); } else if (equalsOrSuffix(qName, "groupName") || equalsOrSuffix(qName, "groupId")) { this.groupId = currentOrNull(currentText); } else if (equalsOrSuffix(qName, "item")) { if (userId != null && groupId != null) builder.userIdGroupPair(userId, groupId); userId = groupId = null; } currentText = new StringBuilder(); }