in providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/xml/SpotInstanceHandler.java [90:169]
public void endElement(String uri, String name, String qName) throws SAXException {
if (equalsOrSuffix(qName, "tagSet")) {
inTagSet = false;
builder.tags(tagSetHandler.getResult());
} else if (inTagSet) {
tagSetHandler.endElement(uri, name, qName);
}
if (qName.equals("launchSpecification")) {
inLaunchSpecification = false;
builder.launchSpecification(launchSpecificationHandler.getResult());
} else if (inLaunchSpecification) {
launchSpecificationHandler.endElement(uri, name, qName);
}
if (qName.equals("fault")) {
inFault = false;
}
if (qName.equals("status")) {
inStatus = false;
}
if (qName.equals("spotInstanceRequestId")) {
builder.id(currentOrNull(currentText));
} else if (qName.equals("instanceId")) {
builder.instanceId(currentOrNull(currentText));
} else if (qName.equals("launchedAvailabilityZone")) {
builder.launchedAvailabilityZone(currentOrNull(currentText));
} else if (qName.equals("availabilityZoneGroup")) {
builder.availabilityZoneGroup(currentOrNull(currentText));
} else if (qName.equals("launchGroup")) {
builder.launchGroup(currentOrNull(currentText));
} else if (qName.equals("spotPrice")) {
String price = currentOrNull(currentText);
if (price != null)
builder.spotPrice(Float.parseFloat(price));
} else if (qName.equals("type")) {
String type = currentOrNull(currentText);
if (type != null)
builder.type(SpotInstanceRequest.Type.fromValue(type));
} else if (qName.equals("state")) {
String rawState = currentOrNull(currentText);
if (rawState != null) {
builder.rawState(rawState);
builder.state(SpotInstanceRequest.State.fromValue(rawState));
}
} else if (qName.equals("createTime")) {
String createTime = currentOrNull(currentText);
if (createTime != null)
builder.createTime(dateService.iso8601DateOrSecondsDateParse(createTime));
} else if (qName.equals("productDescription")) {
builder.productDescription(currentOrNull(currentText));
} else if (inFault) {
if (qName.equals("code")) {
builder.faultCode(currentOrNull(currentText));
} else if (qName.equals("message")) {
builder.faultMessage(currentOrNull(currentText));
}
} else if (inStatus) {
if (qName.equals("code")) {
builder.statusCode(currentOrNull(currentText));
} else if (qName.equals("message")) {
builder.statusMessage(currentOrNull(currentText));
} else if (qName.equals("updateTime")) {
String updateTime = currentOrNull(currentText);
if (updateTime != null)
builder.statusUpdateTime(dateService.iso8601DateOrSecondsDateParse(updateTime));
}
} else if (qName.equals("validFrom")) {
String validFrom = currentOrNull(currentText);
if (validFrom != null)
builder.validFrom(dateService.iso8601DateOrSecondsDateParse(validFrom));
} else if (qName.equals("validUntil")) {
String validUntil = currentOrNull(currentText);
if (validUntil != null)
builder.validUntil(dateService.iso8601DateOrSecondsDateParse(validUntil));
}
currentText.setLength(0);
}