private static void setParser(final ExtensionParsingContext context, final Namespace namespace, final XMLElementReader<List<ModelNode>> parser) { context.setSubsystemXmlMapping(SUBSYSTEM_NAME, namespace.getUriString(), parser); }
private static void setParser(final ExtensionParsingContext context, final Namespace namespace, final XMLElementReader<List<ModelNode>> parser) { context.setSubsystemXmlMapping(SUBSYSTEM_NAME, namespace.getUriString(), parser); }
@Override public void initializeParsers(final ExtensionParsingContext context) { for (Namespace namespace : Namespace.readable()) { context.setSubsystemXmlMapping(SUBSYSTEM_NAME, namespace.getUriString(), LoggingSubsystemParser.INSTANCE); } }
@Override public void writeContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context) throws XMLStreamException { context.startSubsystemElement(Namespace.CURRENT.getUriString(), false); ModelNode node = context.getModelNode(); writeContent(writer, node); if (node.hasDefined(LOGGING_PROFILE)) { final List<Property> profiles = node.get(LOGGING_PROFILE).asPropertyList(); if (!profiles.isEmpty()) { writer.writeStartElement(LOGGING_PROFILES); for (Property profile : profiles) { final String name = profile.getName(); writer.writeStartElement(LOGGING_PROFILE); writer.writeAttribute(Attribute.NAME.getLocalName(), name); writeContent(writer, profile.getValue()); writer.writeEndElement(); } writer.writeEndElement(); } } writer.writeEndElement(); }
@Override public void writeContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context) throws XMLStreamException { context.startSubsystemElement(Namespace.CURRENT.getUriString(), false); ModelNode model = context.getModelNode(); // Marshall attributes for (AttributeDefinition attribute : LoggingResourceDefinition.ATTRIBUTES) { attribute.marshallAsElement(model, false, writer); } writeContent(writer, model); if (model.hasDefined(LOGGING_PROFILE)) { final List<Property> profiles = model.get(LOGGING_PROFILE).asPropertyList(); if (!profiles.isEmpty()) { writer.writeStartElement(LOGGING_PROFILES); for (Property profile : profiles) { final String name = profile.getName(); writer.writeStartElement(LOGGING_PROFILE); writer.writeAttribute(Attribute.NAME.getLocalName(), name); writeContent(writer, profile.getValue()); writer.writeEndElement(); } writer.writeEndElement(); } } writer.writeEndElement(); }
@Override public void writeContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context) throws XMLStreamException { context.startSubsystemElement(Namespace.CURRENT.getUriString(), false); ModelNode model = context.getModelNode(); // Marshall attributes for (AttributeDefinition attribute : LoggingResourceDefinition.ATTRIBUTES) { attribute.marshallAsElement(model, false, writer); } writeContent(writer, model); if (model.hasDefined(LOGGING_PROFILE)) { final List<Property> profiles = model.get(LOGGING_PROFILE).asPropertyList(); if (!profiles.isEmpty()) { writer.writeStartElement(LOGGING_PROFILES); for (Property profile : profiles) { final String name = profile.getName(); writer.writeStartElement(LOGGING_PROFILE); writer.writeAttribute(Attribute.NAME.getLocalName(), name); writeContent(writer, profile.getValue()); writer.writeEndElement(); } writer.writeEndElement(); } } writer.writeEndElement(); }