/** * <p> * If the <code>Attribute</code> value is <code>Properties</code>, the name of the property. For all other * attributes, the value is null. * </p> * * @param name * If the <code>Attribute</code> value is <code>Properties</code>, the name of the property. For all other * attributes, the value is null. * @return Returns a reference to this object so that method calls can be chained together. */ public ResourceTargetDefinition withName(String name) { setName(name); return this; }
public ResourceTargetDefinition unmarshall(StaxUnmarshallerContext context) throws Exception { ResourceTargetDefinition resourceTargetDefinition = new ResourceTargetDefinition(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return resourceTargetDefinition; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Attribute", targetDepth)) { resourceTargetDefinition.setAttribute(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Name", targetDepth)) { resourceTargetDefinition.setName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("RequiresRecreation", targetDepth)) { resourceTargetDefinition.setRequiresRecreation(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return resourceTargetDefinition; } } } }
/** * <p> * If the <code>Attribute</code> value is <code>Properties</code>, the name of the property. For all other * attributes, the value is null. * </p> * * @param name * If the <code>Attribute</code> value is <code>Properties</code>, the name of the property. For all other * attributes, the value is null. * @return Returns a reference to this object so that method calls can be chained together. */ public ResourceTargetDefinition withName(String name) { setName(name); return this; }
public ResourceTargetDefinition unmarshall(StaxUnmarshallerContext context) throws Exception { ResourceTargetDefinition resourceTargetDefinition = new ResourceTargetDefinition(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return resourceTargetDefinition; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Attribute", targetDepth)) { resourceTargetDefinition.setAttribute(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Name", targetDepth)) { resourceTargetDefinition.setName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("RequiresRecreation", targetDepth)) { resourceTargetDefinition.setRequiresRecreation(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return resourceTargetDefinition; } } } }