/** * Reads the single {@code name} attribute from an element. * * @param reader the reader to use * * @return the value of the {@code name} attribute * * @throws XMLStreamException if the {@code name} attribute is not present, there is more than one attribute on the * element or there is content within the element. */ static String readNameAttribute(final XMLExtendedStreamReader reader) throws XMLStreamException { return readStringAttributeElement(reader, Attribute.NAME.getLocalName()); }
/** * Reads the single {@code value} attribute from an element. * * @param reader the reader to use * * @return the value of the {@code value} attribute * * @throws XMLStreamException if the {@code value} attribute is not present, there is more than one attribute on the * element or there is content within the element. */ static String readValueAttribute(final XMLExtendedStreamReader reader) throws XMLStreamException { return readStringAttributeElement(reader, Attribute.VALUE.getLocalName()); }
/** * Reads the single {@code value} attribute from an element. * * @param reader the reader to use * * @return the value of the {@code value} attribute * * @throws XMLStreamException if the {@code value} attribute is not present, there is more than one attribute on the * element or there is content within the element. */ static String readValueAttribute(final XMLExtendedStreamReader reader) throws XMLStreamException { return readStringAttributeElement(reader, Attribute.VALUE.getLocalName()); }
/** * Reads the single {@code name} attribute from an element. * * @param reader the reader to use * * @return the value of the {@code name} attribute * * @throws XMLStreamException if the {@code name} attribute is not present, there is more than one attribute on the * element or there is content within the element. */ static String readNameAttribute(final XMLExtendedStreamReader reader) throws XMLStreamException { return readStringAttributeElement(reader, Attribute.NAME.getLocalName()); }
@Override public void marshallAsElement(final AttributeDefinition attribute, final ModelNode resourceModel, final boolean marshallDefault, final XMLStreamWriter writer) throws XMLStreamException { if (isMarshallable(attribute, resourceModel, marshallDefault)) { writer.writeStartElement(AbstractHandlerDefinition.FORMATTER.getXmlName()); writer.writeStartElement(attribute.getXmlName()); final String content = resourceModel.get(attribute.getName()).asString(); writer.writeAttribute(Attribute.SYSLOG_TYPE.getLocalName(), content); writer.writeEndElement(); writer.writeEndElement(); } } })
@Override public void marshallAsElement(final AttributeDefinition attribute, final ModelNode resourceModel, final boolean marshallDefault, final XMLStreamWriter writer) throws XMLStreamException { if (isMarshallable(attribute, resourceModel, marshallDefault)) { writer.writeStartElement(CommonAttributes.FORMATTER.getXmlName()); writer.writeStartElement(attribute.getXmlName()); final String content = resourceModel.get(attribute.getName()).asString(); writer.writeAttribute(Attribute.SYSLOG_TYPE.getLocalName(), content); writer.writeEndElement(); writer.writeEndElement(); } } })
@Override public void marshallAsElement(final AttributeDefinition attribute, final ModelNode resourceModel, final boolean marshallDefault, final XMLStreamWriter writer) throws XMLStreamException { if (isMarshallable(attribute, resourceModel, marshallDefault)) { writer.writeStartElement(AbstractHandlerDefinition.FORMATTER.getXmlName()); writer.writeStartElement(attribute.getXmlName()); final String content = resourceModel.get(attribute.getName()).asString(); writer.writeAttribute(Attribute.SYSLOG_TYPE.getLocalName(), content); writer.writeEndElement(); writer.writeEndElement(); } } })
private static void parseFilter(final Namespace namespace, final ModelNode node, final XMLExtendedStreamReader reader) throws XMLStreamException { if (namespace == Namespace.LOGGING_1_0 || namespace == Namespace.LOGGING_1_1) { // No attributes if (reader.getAttributeCount() > 0) { throw unexpectedAttribute(reader, 0); } final StringBuilder filter = new StringBuilder(); parseFilterChildren(filter, false, reader); node.get(FILTER_SPEC.getName()).set(filter.toString()); } else { FILTER_SPEC.parseAndSetParameter(readStringAttributeElement(reader, Attribute.VALUE.getLocalName()), node, reader); } }
throw missingRequired(reader, Collections.singleton(Attribute.NAME.getLocalName()));
throw missingRequired(reader, Collections.singleton(Attribute.NAME.getLocalName()));
throw missingRequired(reader, Collections.singleton(Attribute.NAME.getLocalName()));
switch (element) { case ADD_LOGGING_API_DEPENDENCIES: { final String value = ParseUtils.readStringAttributeElement(reader, Attribute.VALUE.getLocalName()); LoggingResourceDefinition.ADD_LOGGING_API_DEPENDENCIES.parseAndSetParameter(value, subsystemAddOp, reader); break; final String value = ParseUtils.readStringAttributeElement(reader, Attribute.VALUE.getLocalName()); LoggingResourceDefinition.USE_DEPLOYMENT_LOGGING_CONFIG.parseAndSetParameter(value, subsystemAddOp, reader); break;
switch (element) { case ADD_LOGGING_API_DEPENDENCIES: { final String value = ParseUtils.readStringAttributeElement(reader, Attribute.VALUE.getLocalName()); LoggingResourceDefinition.ADD_LOGGING_API_DEPENDENCIES.parseAndSetParameter(value, subsystemAddOp, reader); break;
switch (element) { case ADD_LOGGING_API_DEPENDENCIES: { final String value = ParseUtils.readStringAttributeElement(reader, Attribute.VALUE.getLocalName()); LoggingResourceDefinition.ADD_LOGGING_API_DEPENDENCIES.parseAndSetParameter(value, subsystemAddOp, reader); break;
private void writeFileHandler(final XMLExtendedStreamWriter writer, final ModelNode model, final String name) throws XMLStreamException { writer.writeStartElement(Element.FILE_HANDLER.getLocalName()); writer.writeAttribute(Attribute.NAME.getLocalName(), name); AUTOFLUSH.marshallAsAttribute(model, writer); ENABLED.marshallAsAttribute(model, false, writer); writeCommonHandler(writer, model); FILE.marshallAsElement(model, writer); APPEND.marshallAsElement(model, writer); writer.writeEndElement(); }
private void writeFileHandler(final XMLExtendedStreamWriter writer, final ModelNode model, final String name) throws XMLStreamException { writer.writeStartElement(Element.FILE_HANDLER.getLocalName()); writer.writeAttribute(Attribute.NAME.getLocalName(), name); AUTOFLUSH.marshallAsAttribute(model, writer); ENABLED.marshallAsAttribute(model, false, writer); writeCommonHandler(writer, model); FILE.marshallAsElement(model, writer); APPEND.marshallAsElement(model, writer); writer.writeEndElement(); }
private void writeFileHandler(final XMLExtendedStreamWriter writer, final ModelNode node, final String name) throws XMLStreamException { writer.writeStartElement(Element.FILE_HANDLER.getLocalName()); writer.writeAttribute(Attribute.NAME.getLocalName(), name); AUTOFLUSH.marshallAsAttribute(node, writer); ENABLED.marshallAsAttribute(node, false, writer); writeCommonHandler(writer, node); FILE.marshallAsElement(node, writer); APPEND.marshallAsElement(node, writer); writer.writeEndElement(); }
@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(); }