legacy/web/src/main/java/org/jboss/as/web/WebSubsystemParser.java
@Override
    public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
        PathAddress address = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, WebExtension.SUBSYSTEM_NAME));

        final ModelNode subsystem = new ModelNode();
        subsystem.get(OP).set(ADD);
        subsystem.get(OP_ADDR).set(address.toModelNode());
        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));
            switch (attribute) {
                case NATIVE:
                    WebDefinition.NATIVE.parseAndSetParameter(value, subsystem, reader);
                    break;
                case DEFAULT_VIRTUAL_SERVER:
                    WebDefinition.DEFAULT_VIRTUAL_SERVER.parseAndSetParameter(value, subsystem, reader);
                    break;
                case INSTANCE_ID:
                    WebDefinition.INSTANCE_ID.parseAndSetParameter(value, subsystem, reader);
                    break;
                case DEFAULT_SESSION_TIMEOUT:
                    attributeSupportedSince(Namespace.WEB_2_2, reader, i);
                    WebDefinition.DEFAULT_SESSION_TIMEOUT.parseAndSetParameter(value, subsystem, reader);
                    break;
                default:
                    throw unexpectedAttribute(reader, i);
            }
        }
        list.add(subsystem);
        boolean containerConfigDefined = false;
        final Namespace namespace = Namespace.forUri(reader.getNamespaceURI());
        // elements
        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            switch (namespace) {
                case WEB_1_0:
                case WEB_1_1:
                case WEB_1_2:
                case WEB_1_3: {
                    final Element element = Element.forName(reader.getLocalName());
                    switch (element) {
                        case CONTAINER_CONFIG: {
                            parseContainerConfig(reader, address, list);
                            containerConfigDefined = true;
                            break;
                        }
                        case CONNECTOR: {
                            parseConnector(reader, address, list);
                            break;
                        }
                        case VIRTUAL_SERVER: {
                            parseHost(reader, address, list);
                            break;
                        }
                        default: {
                            throw unexpectedElement(reader);
                        }
                    }
                    break;
                }
                case WEB_1_4:
                case WEB_1_5:
                case WEB_2_0:
                case WEB_2_1:
                case WEB_2_2:
                {
                    final Element element = Element.forName(reader.getLocalName());
                    switch (element) {
                        case CONTAINER_CONFIG: {
                            parseContainerConfig(reader, address, list);
                            containerConfigDefined = true;
                            break;
                        }
                        case CONNECTOR: {
                            parseConnector(reader, address, list);
                            break;
                        }
                        case VIRTUAL_SERVER: {
                            parseHost(reader, address, list);
                            break;
                        }
                        case VALVE: {
                            parseValve(reader, address, list);
                            break;
                        }
                        default: {
                            throw unexpectedElement(reader);
                        }
                    }
                    break;
                }
                default: {
                    throw unexpectedElement(reader);
                }
            }
        }
        if (!containerConfigDefined) {
            addDefaultContainerConfig(address, list);
        }

    }
@Override
    public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
        PathAddress address = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, WebExtension.SUBSYSTEM_NAME));

        final ModelNode subsystem = new ModelNode();
        subsystem.get(OP).set(ADD);
        subsystem.get(OP_ADDR).set(address.toModelNode());
        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));
            switch (attribute) {
                case NATIVE:
                    WebDefinition.NATIVE.parseAndSetParameter(value, subsystem, reader);
                    break;
                case DEFAULT_VIRTUAL_SERVER:
                    WebDefinition.DEFAULT_VIRTUAL_SERVER.parseAndSetParameter(value, subsystem, reader);
                    break;
                case INSTANCE_ID:
                    WebDefinition.INSTANCE_ID.parseAndSetParameter(value, subsystem, reader);
                    break;
                case DEFAULT_SESSION_TIMEOUT:
                    attributeSupportedSince(Namespace.WEB_2_2, reader, i);
                    WebDefinition.DEFAULT_SESSION_TIMEOUT.parseAndSetParameter(value, subsystem, reader);
                    break;
                default:
                    throw unexpectedAttribute(reader, i);
            }
        }
        list.add(subsystem);
        boolean containerConfigDefined = false;
        final Namespace namespace = Namespace.forUri(reader.getNamespaceURI());
        // elements
        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            switch (namespace) {
                case WEB_1_0:
                case WEB_1_1:
                case WEB_1_2:
                case WEB_1_3: {
                    final Element element = Element.forName(reader.getLocalName());
                    switch (element) {
                        case CONTAINER_CONFIG: {
                            parseContainerConfig(reader, address, list);
                            containerConfigDefined = true;
                            break;
                        }
                        case CONNECTOR: {
                            parseConnector(reader, address, list);
                            break;
                        }
                        case VIRTUAL_SERVER: {
                            parseHost(reader, address, list);
                            break;
                        }
                        default: {
                            throw unexpectedElement(reader);
                        }
                    }
                    break;
                }
                case WEB_1_4:
                case WEB_1_5:
                case WEB_2_0:
                case WEB_2_1:
                case WEB_2_2:
                {
                    final Element element = Element.forName(reader.getLocalName());
                    switch (element) {
                        case CONTAINER_CONFIG: {
                            parseContainerConfig(reader, address, list);
                            containerConfigDefined = true;
                            break;
                        }
                        case CONNECTOR: {
                            parseConnector(reader, address, list);
                            break;
                        }
                        case VIRTUAL_SERVER: {
                            parseHost(reader, address, list);
                            break;
                        }
                        case VALVE: {
                            parseValve(reader, address, list);
                            break;
                        }
                        default: {
                            throw unexpectedElement(reader);
                        }
                    }
                    break;
                }
                default: {
                    throw unexpectedElement(reader);
                }
            }
        }
        if (!containerConfigDefined) {
            addDefaultContainerConfig(address, list);
        }

    }
@ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > list ) throws XMLStreamException { PathAddress address = PathAddress . pathAddress ( PathElement . pathElement ( SUBSYSTEM , WebExtension . SUBSYSTEM_NAME ) ) ; final ModelNode subsystem = new ModelNode ( ) ; subsystem . get ( OP ) . set ( ADD ) ; subsystem . get ( OP_ADDR ) . set ( address . toModelNode ( ) ) ; 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 ) ) ; switch ( attribute ) { case NATIVE : WebDefinition . NATIVE . parseAndSetParameter ( value , subsystem , reader ) ; break ; case DEFAULT_VIRTUAL_SERVER : WebDefinition . DEFAULT_VIRTUAL_SERVER . parseAndSetParameter ( value , subsystem , reader ) ; break ; case INSTANCE_ID : WebDefinition . INSTANCE_ID . parseAndSetParameter ( value , subsystem , reader ) ; break ; case DEFAULT_SESSION_TIMEOUT : attributeSupportedSince ( Namespace . WEB_2_2 , reader , i ) ; WebDefinition . DEFAULT_SESSION_TIMEOUT . parseAndSetParameter ( value , subsystem , reader ) ; break ; default : throw unexpectedAttribute ( reader , i ) ; } } list . add ( subsystem ) ; boolean containerConfigDefined = false ; final Namespace namespace = Namespace . forUri ( reader . getNamespaceURI ( ) ) ; // elements while ( reader . hasNext ( ) && reader . nextTag ( ) != END_ELEMENT ) { switch ( namespace ) { case WEB_1_0 : case WEB_1_1 : case WEB_1_2 : case WEB_1_3 : { final Element element = Element . forName ( reader . getLocalName ( ) ) ; switch ( element ) { case CONTAINER_CONFIG : { parseContainerConfig ( reader , address , list ) ; containerConfigDefined = true ; break ; } case CONNECTOR : { parseConnector ( reader , address , list ) ; break ; } case VIRTUAL_SERVER : { parseHost ( reader , address , list ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } break ; } case WEB_1_4 : case WEB_1_5 : case WEB_2_0 : case WEB_2_1 : case WEB_2_2 : { final Element element = Element . forName ( reader . getLocalName ( ) ) ; switch ( element ) { case CONTAINER_CONFIG : { parseContainerConfig ( reader , address , list ) ; containerConfigDefined = true ; break ; } case CONNECTOR : { parseConnector ( reader , address , list ) ; break ; } case VIRTUAL_SERVER : { parseHost ( reader , address , list ) ; break ; } case VALVE : { parseValve ( reader , address , list ) ; break ; } default : { throw unexpectedElement ( reader ) ; } } break ; } default : { throw unexpectedElement ( reader ) ; } } } if ( ! containerConfigDefined ) { addDefaultContainerConfig ( address , list ) ; } }
{@inheritDoc}
{