private static String parsePatternFormatterElement(final XMLExtendedStreamReader reader) throws XMLStreamException { String pattern = null; final EnumSet<Attribute> required = EnumSet.of(Attribute.PATTERN); final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); required.remove(attribute); switch (attribute) { case PATTERN: { pattern = value; break; } default: throw unexpectedAttribute(reader, i); } } if (!required.isEmpty()) { throw missingRequired(reader, required); } requireNoContent(reader); return pattern; }
requireNoNamespaceAttribute(reader, i); final String attrValue = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case NAME: { throw missingRequired(reader, Collections.singleton(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()); }
void parsePatternFormatterElement(final XMLExtendedStreamReader reader, final ModelNode operation) throws XMLStreamException { final EnumSet<Attribute> required = EnumSet.of(Attribute.PATTERN); final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); required.remove(attribute); switch (attribute) { case PATTERN: { PatternFormatterResourceDefinition.PATTERN.parseAndSetParameter(value, operation, reader); break; } case COLOR_MAP: { PatternFormatterResourceDefinition.COLOR_MAP.parseAndSetParameter(value, operation, reader); break; } default: throw unexpectedAttribute(reader, i); } } if (!required.isEmpty()) { throw missingRequired(reader, required); } requireNoContent(reader); }
requireNoNamespaceAttribute(reader, i); final String attrValue = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case NAME: { throw missingRequired(reader, Collections.singleton(Attribute.NAME.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()); }
private static void parseFileElement(final ModelNode node, final XMLExtendedStreamReader reader) throws XMLStreamException { final EnumSet<Attribute> required = EnumSet.of(Attribute.PATH); final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); required.remove(attribute); switch (attribute) { case PATH: { PATH.parseAndSetParameter(value, node, reader); break; } case RELATIVE_TO: { RELATIVE_TO.parseAndSetParameter(value, node, reader); break; } default: { throw unexpectedAttribute(reader, i); } } } requireNoContent(reader); }
requireNoNamespaceAttribute(reader, i); final String attrValue = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case NAME: { throw missingRequired(reader, Collections.singleton(Attribute.NAME.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()); }
void parsePatternFormatterElement(final XMLExtendedStreamReader reader, final ModelNode operation) throws XMLStreamException { final EnumSet<Attribute> required = EnumSet.of(Attribute.PATTERN); final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); required.remove(attribute); switch (attribute) { case PATTERN: { PatternFormatterResourceDefinition.PATTERN.parseAndSetParameter(value, operation, reader); break; } case COLOR_MAP: { PatternFormatterResourceDefinition.COLOR_MAP.parseAndSetParameter(value, operation, reader); break; } default: throw unexpectedAttribute(reader, i); } } if (!required.isEmpty()) { throw missingRequired(reader, required); } requireNoContent(reader); }
requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); required.remove(attribute); switch (attribute) { requireSingleAttribute(reader, Attribute.SYSLOG_TYPE.getLocalName()); model.get(SYSLOG_FORMATTER.getName()).set(readStringAttributeElement(reader, Attribute.SYSLOG_TYPE.getLocalName())); requireNoContent(reader); break;
@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(); } } })
void parseFileElement(final ModelNode operation, final XMLExtendedStreamReader reader) throws XMLStreamException { final EnumSet<Attribute> required = EnumSet.of(Attribute.PATH); final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); required.remove(attribute); switch (attribute) { case PATH: { PATH.parseAndSetParameter(value, operation, reader); break; } case RELATIVE_TO: { RELATIVE_TO.parseAndSetParameter(value, operation, reader); break; } default: { throw unexpectedAttribute(reader, i); } } } requireNoContent(reader); }
requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); required.remove(attribute); switch (attribute) { requireSingleAttribute(reader, Attribute.SYSLOG_TYPE.getLocalName()); operation.get(SYSLOG_FORMATTER.getName()).set(readStringAttributeElement(reader, Attribute.SYSLOG_TYPE.getLocalName())); requireNoContent(reader); break;
@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(); } } })
void parseFileElement(final ModelNode operation, final XMLExtendedStreamReader reader) throws XMLStreamException { final EnumSet<Attribute> required = EnumSet.of(Attribute.PATH); final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); required.remove(attribute); switch (attribute) { case PATH: { PATH.parseAndSetParameter(value, operation, reader); break; } case RELATIVE_TO: { RELATIVE_TO.parseAndSetParameter(value, operation, reader); break; } default: { throw unexpectedAttribute(reader, i); } } } requireNoContent(reader); }
requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); required.remove(attribute); switch (attribute) { requireSingleAttribute(reader, Attribute.SYSLOG_TYPE.getLocalName()); operation.get(SYSLOG_FORMATTER.getName()).set(readStringAttributeElement(reader, Attribute.SYSLOG_TYPE.getLocalName())); requireNoContent(reader); break;
@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(); } } })
requireNoNamespaceAttribute(reader, i); final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); required.remove(attribute); switch (attribute) {