/** * <p> * The device name (for example, <code>/dev/sdh</code> or <code>xvdh</code>). * </p> * * @param deviceName * The device name (for example, <code>/dev/sdh</code> or <code>xvdh</code>). * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceBlockDeviceMapping withDeviceName(String deviceName) { setDeviceName(deviceName); return this; }
public InstanceBlockDeviceMapping unmarshall(StaxUnmarshallerContext context) throws Exception { InstanceBlockDeviceMapping instanceBlockDeviceMapping = new InstanceBlockDeviceMapping(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return instanceBlockDeviceMapping; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("deviceName", targetDepth)) { instanceBlockDeviceMapping.setDeviceName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("ebs", targetDepth)) { instanceBlockDeviceMapping.setEbs(EbsInstanceBlockDeviceStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return instanceBlockDeviceMapping; } } } }
/** * <p> * The device name (for example, <code>/dev/sdh</code> or <code>xvdh</code>). * </p> * * @param deviceName * The device name (for example, <code>/dev/sdh</code> or <code>xvdh</code>). * @return Returns a reference to this object so that method calls can be chained together. */ public InstanceBlockDeviceMapping withDeviceName(String deviceName) { setDeviceName(deviceName); return this; }
public InstanceBlockDeviceMapping unmarshall(StaxUnmarshallerContext context) throws Exception { InstanceBlockDeviceMapping instanceBlockDeviceMapping = new InstanceBlockDeviceMapping(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) return instanceBlockDeviceMapping; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("deviceName", targetDepth)) { instanceBlockDeviceMapping.setDeviceName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("ebs", targetDepth)) { instanceBlockDeviceMapping.setEbs(EbsInstanceBlockDeviceStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { return instanceBlockDeviceMapping; } } } }
public InstanceBlockDeviceMapping unmarshall(StaxUnmarshallerContext context) throws Exception { InstanceBlockDeviceMapping instanceBlockDeviceMapping = new InstanceBlockDeviceMapping(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return instanceBlockDeviceMapping; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("deviceName", targetDepth)) { instanceBlockDeviceMapping.setDeviceName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("ebs", targetDepth)) { instanceBlockDeviceMapping.setEbs(EbsInstanceBlockDeviceStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return instanceBlockDeviceMapping; } } } }