public void parse(final XMLExtendedStreamReader reader, final ModelNode operation) throws XMLStreamException { while (reader.hasNext() && reader.nextTag() != XMLStreamConstants.END_ELEMENT) { if (reader.getLocalName().equals(getXmlName())) { final String[] array = requireAttributes( reader, org.jboss.as.controller.parsing.Attribute.NAME.getLocalName(), org.jboss.as.controller.parsing.Attribute.VALUE.getLocalName()); parseAndAddParameterElement(array[0], array[1], operation, reader); ParseUtils.requireNoContent(reader); } else { throw ParseUtils.unexpectedElement(reader); } } }
@Override public void marshallAsElement( AttributeDefinition attribute, ModelNode resourceModel, boolean marshallDefault, XMLStreamWriter writer) throws XMLStreamException { resourceModel = resourceModel.get(attribute.getName()); if (wrapElement) { writer.writeStartElement(wrapperElement == null ? attribute.getName() : wrapperElement); } for (ModelNode property : resourceModel.asList()) { writer.writeEmptyElement(attribute.getXmlName()); writer.writeAttribute( org.jboss.as.controller.parsing.Attribute.NAME.getLocalName(), property.asProperty().getName()); writer.writeAttribute( org.jboss.as.controller.parsing.Attribute.VALUE.getLocalName(), property.asProperty().getValue().asString()); } if (wrapElement) { writer.writeEndElement(); } }