Java Code Examples for org.jboss.as.controller.parsing.ParseUtils#readStringAttributeElement()
The following examples show how to use
org.jboss.as.controller.parsing.ParseUtils#readStringAttributeElement() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: KeycloakSubsystemParser.java From keycloak with Apache License 2.0 | 6 votes |
void readRoleIdentifiers(ModelNode addServiceProvider, XMLExtendedStreamReader reader) throws XMLStreamException { ParseUtils.requireNoAttributes(reader); while (reader.hasNext() && nextTag(reader) != END_ELEMENT) { String tagName = reader.getLocalName(); if (!Constants.XML.ATTRIBUTE.equals(tagName)) { throw ParseUtils.unexpectedElement(reader); } ParseUtils.requireSingleAttribute(reader, Constants.XML.NAME); String name = ParseUtils.readStringAttributeElement(reader, Constants.XML.NAME); ServiceProviderDefinition.ROLE_ATTRIBUTES.parseAndAddParameterElement(name, addServiceProvider, reader); } }
Example 2
Source File: KeycloakSubsystemParser.java From keycloak with Apache License 2.0 | 6 votes |
void readRoleIdentifiers(ModelNode addServiceProvider, XMLExtendedStreamReader reader) throws XMLStreamException { ParseUtils.requireNoAttributes(reader); while (reader.hasNext() && nextTag(reader) != END_ELEMENT) { String tagName = reader.getLocalName(); if (!Constants.XML.ATTRIBUTE.equals(tagName)) { throw ParseUtils.unexpectedElement(reader); } ParseUtils.requireSingleAttribute(reader, Constants.XML.NAME); String name = ParseUtils.readStringAttributeElement(reader, Constants.XML.NAME); ServiceProviderDefinition.ROLE_ATTRIBUTES.parseAndAddParameterElement(name, addServiceProvider, reader); } }
Example 3
Source File: LoggingSubsystemParser_1_5.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
@Override public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> operations) throws XMLStreamException { // No attributes ParseUtils.requireNoAttributes(reader); // Subsystem add operation final ModelNode subsystemAddOp = Util.createAddOperation(SUBSYSTEM_ADDRESS); operations.add(subsystemAddOp); final List<ModelNode> loggerOperations = new ArrayList<>(); final List<ModelNode> asyncHandlerOperations = new ArrayList<>(); final List<ModelNode> handlerOperations = new ArrayList<>(); final List<ModelNode> formatterOperations = new ArrayList<>(); // Elements final Set<String> loggerNames = new HashSet<>(); final Set<String> handlerNames = new HashSet<>(); final Set<String> formatterNames = new HashSet<>(); boolean rootDefined = false; while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { final Element element = Element.forName(reader.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; } case LOGGER: { parseLoggerElement(reader, SUBSYSTEM_ADDRESS, loggerOperations, loggerNames); break; } case ROOT_LOGGER: { if (rootDefined) { throw unexpectedElement(reader); } rootDefined = true; parseRootLoggerElement(reader, SUBSYSTEM_ADDRESS, loggerOperations); break; } case CONSOLE_HANDLER: { parseConsoleHandlerElement(reader, SUBSYSTEM_ADDRESS, handlerOperations, handlerNames); break; } case FILE_HANDLER: { parseFileHandlerElement(reader, SUBSYSTEM_ADDRESS, handlerOperations, handlerNames); break; } case CUSTOM_HANDLER: { parseCustomHandlerElement(reader, SUBSYSTEM_ADDRESS, handlerOperations, handlerNames); break; } case PERIODIC_ROTATING_FILE_HANDLER: { parsePeriodicRotatingFileHandlerElement(reader, SUBSYSTEM_ADDRESS, handlerOperations, handlerNames); break; } case PERIODIC_SIZE_ROTATING_FILE_HANDLER: { parsePeriodicSizeRotatingHandlerElement(reader, SUBSYSTEM_ADDRESS, handlerOperations, handlerNames); break; } case SIZE_ROTATING_FILE_HANDLER: { parseSizeRotatingHandlerElement(reader, SUBSYSTEM_ADDRESS, handlerOperations, handlerNames); break; } case ASYNC_HANDLER: { parseAsyncHandlerElement(reader, SUBSYSTEM_ADDRESS, asyncHandlerOperations, handlerNames); break; } case SYSLOG_HANDLER: { parseSyslogHandler(reader, SUBSYSTEM_ADDRESS, handlerOperations, handlerNames); break; } case LOGGING_PROFILES: { parseLoggingProfilesElement(reader, operations); break; } case FORMATTER: { parseFormatter(reader, SUBSYSTEM_ADDRESS, formatterOperations, formatterNames); } break; default: { reader.handleAny(operations); break; } } } operations.addAll(formatterOperations); operations.addAll(handlerOperations); operations.addAll(asyncHandlerOperations); operations.addAll(loggerOperations); }
Example 4
Source File: LoggingSubsystemParser_1_4.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
@Override public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> operations) throws XMLStreamException { // No attributes ParseUtils.requireNoAttributes(reader); // Subsystem add operation final ModelNode subsystemAddOp = Util.createAddOperation(SUBSYSTEM_ADDRESS); operations.add(subsystemAddOp); final List<ModelNode> loggerOperations = new ArrayList<>(); final List<ModelNode> asyncHandlerOperations = new ArrayList<>(); final List<ModelNode> handlerOperations = new ArrayList<>(); final List<ModelNode> formatterOperations = new ArrayList<>(); // Elements final Set<String> loggerNames = new HashSet<>(); final Set<String> handlerNames = new HashSet<>(); final Set<String> formatterNames = new HashSet<>(); boolean rootDefined = false; while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { final Element element = Element.forName(reader.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; } case LOGGER: { parseLoggerElement(reader, SUBSYSTEM_ADDRESS, loggerOperations, loggerNames); break; } case ROOT_LOGGER: { if (rootDefined) { throw unexpectedElement(reader); } rootDefined = true; parseRootLoggerElement(reader, SUBSYSTEM_ADDRESS, loggerOperations); break; } case CONSOLE_HANDLER: { parseConsoleHandlerElement(reader, SUBSYSTEM_ADDRESS, handlerOperations, handlerNames); break; } case FILE_HANDLER: { parseFileHandlerElement(reader, SUBSYSTEM_ADDRESS, handlerOperations, handlerNames); break; } case CUSTOM_HANDLER: { parseCustomHandlerElement(reader, SUBSYSTEM_ADDRESS, handlerOperations, handlerNames); break; } case PERIODIC_ROTATING_FILE_HANDLER: { parsePeriodicRotatingFileHandlerElement(reader, SUBSYSTEM_ADDRESS, handlerOperations, handlerNames); break; } case SIZE_ROTATING_FILE_HANDLER: { parseSizeRotatingHandlerElement(reader, SUBSYSTEM_ADDRESS, handlerOperations, handlerNames); break; } case ASYNC_HANDLER: { parseAsyncHandlerElement(reader, SUBSYSTEM_ADDRESS, asyncHandlerOperations, handlerNames); break; } case SYSLOG_HANDLER: { parseSyslogHandler(reader, SUBSYSTEM_ADDRESS, handlerOperations, handlerNames); break; } case LOGGING_PROFILES: { parseLoggingProfilesElement(reader, operations); break; } case FORMATTER: { parseFormatter(reader, SUBSYSTEM_ADDRESS, formatterOperations, formatterNames); break; } default: { reader.handleAny(operations); break; } } } operations.addAll(formatterOperations); operations.addAll(handlerOperations); operations.addAll(asyncHandlerOperations); operations.addAll(loggerOperations); }
Example 5
Source File: HostXml_8.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
private void parseIgnoredResource(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list, final Set<String> foundTypes) throws XMLStreamException { ModelNode op = new ModelNode(); op.get(OP).set(ADD); String type = null; final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { if (!isNoNamespaceAttribute(reader, i)) { throw unexpectedAttribute(reader, i); } final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case TYPE: { if (!foundTypes.add(value)) { throw HostControllerLogger.ROOT_LOGGER.duplicateIgnoredResourceType(Element.IGNORED_RESOURCE.getLocalName(), value, reader.getLocation()); } type = value; break; } case WILDCARD: { IgnoredDomainTypeResourceDefinition.WILDCARD.parseAndSetParameter(value, op, reader); break; } default: throw unexpectedAttribute(reader, i); } } if (type == null) { throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.TYPE.getLocalName())); } ModelNode addr = op.get(OP_ADDR).set(address); addr.add(CORE_SERVICE, IGNORED_RESOURCES); addr.add(IGNORED_RESOURCE_TYPE, type); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { requireNamespace(reader, namespace); final Element element = Element.forName(reader.getLocalName()); switch (element) { case INSTANCE: { String name = ParseUtils.readStringAttributeElement(reader, NAME); IgnoredDomainTypeResourceDefinition.NAMES.parseAndAddParameterElement(name, op, reader); break; } default: throw unexpectedElement(reader); } } list.add(op); }
Example 6
Source File: HostXml_11.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
private void parseIgnoredResource(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list, final Set<String> foundTypes) throws XMLStreamException { ModelNode op = new ModelNode(); op.get(OP).set(ADD); String type = null; final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { if (!isNoNamespaceAttribute(reader, i)) { throw unexpectedAttribute(reader, i); } final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case TYPE: { if (!foundTypes.add(value)) { throw HostControllerLogger.ROOT_LOGGER.duplicateIgnoredResourceType(Element.IGNORED_RESOURCE.getLocalName(), value, reader.getLocation()); } type = value; break; } case WILDCARD: { IgnoredDomainTypeResourceDefinition.WILDCARD.parseAndSetParameter(value, op, reader); break; } default: throw unexpectedAttribute(reader, i); } } if (type == null) { throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.TYPE.getLocalName())); } ModelNode addr = op.get(OP_ADDR).set(address); addr.add(CORE_SERVICE, IGNORED_RESOURCES); addr.add(IGNORED_RESOURCE_TYPE, type); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { requireNamespace(reader, namespace); final Element element = Element.forName(reader.getLocalName()); switch (element) { case INSTANCE: { String name = ParseUtils.readStringAttributeElement(reader, NAME); IgnoredDomainTypeResourceDefinition.NAMES.parseAndAddParameterElement(name, op, reader); break; } default: throw unexpectedElement(reader); } } list.add(op); }
Example 7
Source File: HostXml_14.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
private void parseIgnoredResource(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list, final Set<String> foundTypes) throws XMLStreamException { ModelNode op = new ModelNode(); op.get(OP).set(ADD); String type = null; final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { if (!isNoNamespaceAttribute(reader, i)) { throw unexpectedAttribute(reader, i); } final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case TYPE: { if (!foundTypes.add(value)) { throw HostControllerLogger.ROOT_LOGGER.duplicateIgnoredResourceType(Element.IGNORED_RESOURCE.getLocalName(), value, reader.getLocation()); } type = value; break; } case WILDCARD: { IgnoredDomainTypeResourceDefinition.WILDCARD.parseAndSetParameter(value, op, reader); break; } default: throw unexpectedAttribute(reader, i); } } if (type == null) { throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.TYPE.getLocalName())); } ModelNode addr = op.get(OP_ADDR).set(address); addr.add(CORE_SERVICE, IGNORED_RESOURCES); addr.add(IGNORED_RESOURCE_TYPE, type); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { requireNamespace(reader, namespace); final Element element = Element.forName(reader.getLocalName()); switch (element) { case INSTANCE: { String name = ParseUtils.readStringAttributeElement(reader, NAME); IgnoredDomainTypeResourceDefinition.NAMES.parseAndAddParameterElement(name, op, reader); break; } default: throw unexpectedElement(reader); } } list.add(op); }
Example 8
Source File: HostXml_7.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
private void parseIgnoredResource(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list, final Set<String> foundTypes) throws XMLStreamException { ModelNode op = new ModelNode(); op.get(OP).set(ADD); String type = null; final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { if (!isNoNamespaceAttribute(reader, i)) { throw unexpectedAttribute(reader, i); } final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case TYPE: { if (!foundTypes.add(value)) { throw HostControllerLogger.ROOT_LOGGER.duplicateIgnoredResourceType(Element.IGNORED_RESOURCE.getLocalName(), value, reader.getLocation()); } type = value; break; } case WILDCARD: { IgnoredDomainTypeResourceDefinition.WILDCARD.parseAndSetParameter(value, op, reader); break; } default: throw unexpectedAttribute(reader, i); } } if (type == null) { throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.TYPE.getLocalName())); } ModelNode addr = op.get(OP_ADDR).set(address); addr.add(CORE_SERVICE, IGNORED_RESOURCES); addr.add(IGNORED_RESOURCE_TYPE, type); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { requireNamespace(reader, namespace); final Element element = Element.forName(reader.getLocalName()); switch (element) { case INSTANCE: { String name = ParseUtils.readStringAttributeElement(reader, NAME); IgnoredDomainTypeResourceDefinition.NAMES.parseAndAddParameterElement(name, op, reader); break; } default: throw unexpectedElement(reader); } } list.add(op); }
Example 9
Source File: HostXml_6.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
private void parseIgnoredResource(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list, final Set<String> foundTypes) throws XMLStreamException { ModelNode op = new ModelNode(); op.get(OP).set(ADD); String type = null; final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { if (!isNoNamespaceAttribute(reader, i)) { throw unexpectedAttribute(reader, i); } final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case TYPE: { if (!foundTypes.add(value)) { throw HostControllerLogger.ROOT_LOGGER.duplicateIgnoredResourceType(Element.IGNORED_RESOURCE.getLocalName(), value, reader.getLocation()); } type = value; break; } case WILDCARD: { IgnoredDomainTypeResourceDefinition.WILDCARD.parseAndSetParameter(value, op, reader); break; } default: throw unexpectedAttribute(reader, i); } } if (type == null) { throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.TYPE.getLocalName())); } ModelNode addr = op.get(OP_ADDR).set(address); addr.add(CORE_SERVICE, IGNORED_RESOURCES); addr.add(IGNORED_RESOURCE_TYPE, type); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { requireNamespace(reader, namespace); final Element element = Element.forName(reader.getLocalName()); switch (element) { case INSTANCE: { String name = ParseUtils.readStringAttributeElement(reader, NAME); IgnoredDomainTypeResourceDefinition.NAMES.parseAndAddParameterElement(name, op, reader); break; } default: throw unexpectedElement(reader); } } list.add(op); }
Example 10
Source File: HostXml_5.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
private void parseIgnoredResource(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list, final Set<String> foundTypes) throws XMLStreamException { ModelNode op = new ModelNode(); op.get(OP).set(ADD); String type = null; final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { if (!isNoNamespaceAttribute(reader, i)) { throw unexpectedAttribute(reader, i); } final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case TYPE: { if (!foundTypes.add(value)) { throw HostControllerLogger.ROOT_LOGGER.duplicateIgnoredResourceType(Element.IGNORED_RESOURCE.getLocalName(), value, reader.getLocation()); } type = value; break; } case WILDCARD: { IgnoredDomainTypeResourceDefinition.WILDCARD.parseAndSetParameter(value, op, reader); break; } default: throw unexpectedAttribute(reader, i); } } if (type == null) { throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.TYPE.getLocalName())); } ModelNode addr = op.get(OP_ADDR).set(address); addr.add(CORE_SERVICE, IGNORED_RESOURCES); addr.add(IGNORED_RESOURCE_TYPE, type); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { requireNamespace(reader, namespace); final Element element = Element.forName(reader.getLocalName()); switch (element) { case INSTANCE: { String name = ParseUtils.readStringAttributeElement(reader, NAME); IgnoredDomainTypeResourceDefinition.NAMES.parseAndAddParameterElement(name, op, reader); break; } default: throw unexpectedElement(reader); } } list.add(op); }
Example 11
Source File: HostXml_Legacy.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
private void parseIgnoredResource(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list, final Set<String> foundTypes) throws XMLStreamException { ModelNode op = new ModelNode(); op.get(OP).set(ADD); String type = null; final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { if (!isNoNamespaceAttribute(reader, i)) { throw unexpectedAttribute(reader, i); } final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case TYPE: { if (!foundTypes.add(value)) { throw HostControllerLogger.ROOT_LOGGER.duplicateIgnoredResourceType(Element.IGNORED_RESOURCE.getLocalName(), value, reader.getLocation()); } type = value; break; } case WILDCARD: { IgnoredDomainTypeResourceDefinition.WILDCARD.parseAndSetParameter(value, op, reader); break; } default: throw unexpectedAttribute(reader, i); } } if (type == null) { throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.TYPE.getLocalName())); } ModelNode addr = op.get(OP_ADDR).set(address); addr.add(CORE_SERVICE, IGNORED_RESOURCES); addr.add(IGNORED_RESOURCE_TYPE, type); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { requireNamespace(reader, namespace); final Element element = Element.forName(reader.getLocalName()); switch (element) { case INSTANCE: { String name = ParseUtils.readStringAttributeElement(reader, NAME); IgnoredDomainTypeResourceDefinition.NAMES.parseAndAddParameterElement(name, op, reader); break; } default: throw unexpectedElement(reader); } } list.add(op); }
Example 12
Source File: HostXml_4.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
private void parseIgnoredResource(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list, final Set<String> foundTypes) throws XMLStreamException { ModelNode op = new ModelNode(); op.get(OP).set(ADD); String type = null; final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { if (!isNoNamespaceAttribute(reader, i)) { throw unexpectedAttribute(reader, i); } final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case TYPE: { if (!foundTypes.add(value)) { throw HostControllerLogger.ROOT_LOGGER.duplicateIgnoredResourceType(Element.IGNORED_RESOURCE.getLocalName(), value, reader.getLocation()); } type = value; break; } case WILDCARD: { IgnoredDomainTypeResourceDefinition.WILDCARD.parseAndSetParameter(value, op, reader); break; } default: throw unexpectedAttribute(reader, i); } } if (type == null) { throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.TYPE.getLocalName())); } ModelNode addr = op.get(OP_ADDR).set(address); addr.add(CORE_SERVICE, IGNORED_RESOURCES); addr.add(IGNORED_RESOURCE_TYPE, type); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { requireNamespace(reader, namespace); final Element element = Element.forName(reader.getLocalName()); switch (element) { case INSTANCE: { String name = ParseUtils.readStringAttributeElement(reader, NAME); IgnoredDomainTypeResourceDefinition.NAMES.parseAndAddParameterElement(name, op, reader); break; } default: throw unexpectedElement(reader); } } list.add(op); }
Example 13
Source File: HostXml_10.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
private void parseIgnoredResource(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list, final Set<String> foundTypes) throws XMLStreamException { ModelNode op = new ModelNode(); op.get(OP).set(ADD); String type = null; final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { if (!isNoNamespaceAttribute(reader, i)) { throw unexpectedAttribute(reader, i); } final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case TYPE: { if (!foundTypes.add(value)) { throw HostControllerLogger.ROOT_LOGGER.duplicateIgnoredResourceType(Element.IGNORED_RESOURCE.getLocalName(), value, reader.getLocation()); } type = value; break; } case WILDCARD: { IgnoredDomainTypeResourceDefinition.WILDCARD.parseAndSetParameter(value, op, reader); break; } default: throw unexpectedAttribute(reader, i); } } if (type == null) { throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.TYPE.getLocalName())); } ModelNode addr = op.get(OP_ADDR).set(address); addr.add(CORE_SERVICE, IGNORED_RESOURCES); addr.add(IGNORED_RESOURCE_TYPE, type); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { requireNamespace(reader, namespace); final Element element = Element.forName(reader.getLocalName()); switch (element) { case INSTANCE: { String name = ParseUtils.readStringAttributeElement(reader, NAME); IgnoredDomainTypeResourceDefinition.NAMES.parseAndAddParameterElement(name, op, reader); break; } default: throw unexpectedElement(reader); } } list.add(op); }
Example 14
Source File: HostXml_13.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
private void parseIgnoredResource(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list, final Set<String> foundTypes) throws XMLStreamException { ModelNode op = new ModelNode(); op.get(OP).set(ADD); String type = null; final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { if (!isNoNamespaceAttribute(reader, i)) { throw unexpectedAttribute(reader, i); } final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case TYPE: { if (!foundTypes.add(value)) { throw HostControllerLogger.ROOT_LOGGER.duplicateIgnoredResourceType(Element.IGNORED_RESOURCE.getLocalName(), value, reader.getLocation()); } type = value; break; } case WILDCARD: { IgnoredDomainTypeResourceDefinition.WILDCARD.parseAndSetParameter(value, op, reader); break; } default: throw unexpectedAttribute(reader, i); } } if (type == null) { throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.TYPE.getLocalName())); } ModelNode addr = op.get(OP_ADDR).set(address); addr.add(CORE_SERVICE, IGNORED_RESOURCES); addr.add(IGNORED_RESOURCE_TYPE, type); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { requireNamespace(reader, namespace); final Element element = Element.forName(reader.getLocalName()); switch (element) { case INSTANCE: { String name = ParseUtils.readStringAttributeElement(reader, NAME); IgnoredDomainTypeResourceDefinition.NAMES.parseAndAddParameterElement(name, op, reader); break; } default: throw unexpectedElement(reader); } } list.add(op); }
Example 15
Source File: HostXml_9.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
private void parseIgnoredResource(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list, final Set<String> foundTypes) throws XMLStreamException { ModelNode op = new ModelNode(); op.get(OP).set(ADD); String type = null; final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { if (!isNoNamespaceAttribute(reader, i)) { throw unexpectedAttribute(reader, i); } final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case TYPE: { if (!foundTypes.add(value)) { throw HostControllerLogger.ROOT_LOGGER.duplicateIgnoredResourceType(Element.IGNORED_RESOURCE.getLocalName(), value, reader.getLocation()); } type = value; break; } case WILDCARD: { IgnoredDomainTypeResourceDefinition.WILDCARD.parseAndSetParameter(value, op, reader); break; } default: throw unexpectedAttribute(reader, i); } } if (type == null) { throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.TYPE.getLocalName())); } ModelNode addr = op.get(OP_ADDR).set(address); addr.add(CORE_SERVICE, IGNORED_RESOURCES); addr.add(IGNORED_RESOURCE_TYPE, type); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { requireNamespace(reader, namespace); final Element element = Element.forName(reader.getLocalName()); switch (element) { case INSTANCE: { String name = ParseUtils.readStringAttributeElement(reader, NAME); IgnoredDomainTypeResourceDefinition.NAMES.parseAndAddParameterElement(name, op, reader); break; } default: throw unexpectedElement(reader); } } list.add(op); }
Example 16
Source File: HostXml_12.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
private void parseIgnoredResource(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list, final Set<String> foundTypes) throws XMLStreamException { ModelNode op = new ModelNode(); op.get(OP).set(ADD); String type = null; final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { if (!isNoNamespaceAttribute(reader, i)) { throw unexpectedAttribute(reader, i); } final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case TYPE: { if (!foundTypes.add(value)) { throw HostControllerLogger.ROOT_LOGGER.duplicateIgnoredResourceType(Element.IGNORED_RESOURCE.getLocalName(), value, reader.getLocation()); } type = value; break; } case WILDCARD: { IgnoredDomainTypeResourceDefinition.WILDCARD.parseAndSetParameter(value, op, reader); break; } default: throw unexpectedAttribute(reader, i); } } if (type == null) { throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.TYPE.getLocalName())); } ModelNode addr = op.get(OP_ADDR).set(address); addr.add(CORE_SERVICE, IGNORED_RESOURCES); addr.add(IGNORED_RESOURCE_TYPE, type); while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { requireNamespace(reader, namespace); final Element element = Element.forName(reader.getLocalName()); switch (element) { case INSTANCE: { String name = ParseUtils.readStringAttributeElement(reader, NAME); IgnoredDomainTypeResourceDefinition.NAMES.parseAndAddParameterElement(name, op, reader); break; } default: throw unexpectedElement(reader); } } list.add(op); }