/** * <p> * The current state of the instance. * </p> * * @param name * The current state of the instance. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceStateName */ public InstanceState withName(String name) { setName(name); return this; }
public InstanceState unmarshall(StaxUnmarshallerContext context) throws Exception { InstanceState instanceState = new InstanceState(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return instanceState; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("code", targetDepth)) { instanceState.setCode(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("name", targetDepth)) { instanceState.setName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return instanceState; } } } }
/** * <p> * The current state of the instance. * </p> * * @param name * The current state of the instance. * @return Returns a reference to this object so that method calls can be chained together. * @see InstanceStateName */ public InstanceState withName(String name) { setName(name); return this; }
public InstanceState unmarshall(StaxUnmarshallerContext context) throws Exception { InstanceState instanceState = new InstanceState(); 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 instanceState; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("code", targetDepth)) { instanceState.setCode(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("name", targetDepth)) { instanceState.setName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { return instanceState; } } } }
public InstanceState unmarshall(StaxUnmarshallerContext context) throws Exception { InstanceState instanceState = new InstanceState(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return instanceState; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("code", targetDepth)) { instanceState.setCode(IntegerStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("name", targetDepth)) { instanceState.setName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return instanceState; } } } }