当前位置: 首页>>代码示例>>Java>>正文


Java ParseUtils.requireNoAttributes方法代码示例

本文整理汇总了Java中org.jboss.as.controller.parsing.ParseUtils.requireNoAttributes方法的典型用法代码示例。如果您正苦于以下问题:Java ParseUtils.requireNoAttributes方法的具体用法?Java ParseUtils.requireNoAttributes怎么用?Java ParseUtils.requireNoAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.as.controller.parsing.ParseUtils的用法示例。


在下文中一共展示了ParseUtils.requireNoAttributes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readElement

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
    ParseUtils.requireNoAttributes(reader);

    final PathAddress address = PathAddress.pathAddress(OpenShiftSubsystemExtension.SUBSYSTEM_PATH);
    final ModelNode subsystem = Util.getEmptyOperation(ADD, address.toModelNode());
    list.add(subsystem);

    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        if(reader.getLocalName().equals(Constants.MAX_LINE_LENGTH)) {
            final String value = parseElementNoAttributes(reader);
            OpenShiftSubsystemDefinition.MAX_LINE_LENGTH.parseAndSetParameter(value, subsystem, reader);
        } else if(reader.getLocalName().equals(Constants.METRICS_GROUP)) {
            readMetricsGroups(reader, address, list);
        } else {
            throw ParseUtils.unexpectedElement(reader);
        }
    }
}
 
开发者ID:ncdc,项目名称:jboss-openshift-metrics-module,代码行数:23,代码来源:OpenShiftSubsystemParser.java

示例2: readElement

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
    ParseUtils.requireNoAttributes(reader);
    list.add(Util.createAddOperation(PathAddress.pathAddress(ModelDescriptionConstants.SUBSYSTEM, SUBSYSTEM_NAME)));

    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        final String element = reader.getLocalName();
        switch (element) {
            case "child": {
                list.add(parseChild(reader));
                break;
            }
            default: {
                throw ParseUtils.unexpectedElement(reader);
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:19,代码来源:OrderedChildResourceExtension.java

示例3: readElement

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
    ParseUtils.requireNoAttributes(reader);
    list.add(createAddOperation());

    boolean gotConnector = false;

    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        final String element = reader.getLocalName();
        switch (element) {
            case CommonAttributes.JMX_CONNECTOR: {
                if (gotConnector) {
                    throw ParseUtils.duplicateNamedElement(reader, CommonAttributes.JMX_CONNECTOR);
                }
                parseConnector(reader);
                gotConnector = true;
                break;
            }
            default: {
                throw ParseUtils.unexpectedElement(reader);
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:28,代码来源:JMXExtension.java

示例4: parseServerGroupScopedRoles

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
public void parseServerGroupScopedRoles(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list) throws XMLStreamException {

        ParseUtils.requireNoAttributes(reader);

        String scopedRoleType = ServerGroupScopedRoleResourceDefinition.PATH_ELEMENT.getKey();

        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            requireNamespace(reader, namespace);
            final Element element = Element.forName(reader.getLocalName());
            switch (element) {
                case ROLE: {
                    parseScopedRole(reader, address, list, scopedRoleType, Element.SERVER_GROUP,
                            ServerGroupScopedRoleResourceDefinition.BASE_ROLE, ServerGroupScopedRoleResourceDefinition.SERVER_GROUPS, true);
                    break;
                }
                default: {
                    throw unexpectedElement(reader);
                }
            }
        }
    }
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:AccessControlXml.java

示例5: parseHostScopedRoles

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
public void parseHostScopedRoles(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list) throws XMLStreamException {

        ParseUtils.requireNoAttributes(reader);

        String scopedRoleType = HostScopedRolesResourceDefinition.PATH_ELEMENT.getKey();

        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            requireNamespace(reader, namespace);
            final Element element = Element.forName(reader.getLocalName());
            switch (element) {
                case ROLE: {
                    parseScopedRole(reader, address, list, scopedRoleType, Element.HOST,
                            HostScopedRolesResourceDefinition.BASE_ROLE, HostScopedRolesResourceDefinition.HOSTS, false);
                    break;
                }
                default: {
                    throw unexpectedElement(reader);
                }
            }
        }

    }
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:23,代码来源:AccessControlXml.java

示例6: parseIncludeExclude

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
private void parseIncludeExclude(final XMLExtendedStreamReader reader, final ModelNode parentAddress, final String incExcType,
        final List<ModelNode> list) throws XMLStreamException {
    ParseUtils.requireNoAttributes(reader);

    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        requireNamespace(reader, namespace);
        final Element element = Element.forName(reader.getLocalName());
        switch (element) {
            case GROUP: {
                parsePrincipal(reader, parentAddress, incExcType, GROUP, list);
                break;
            }
            case USER: {
                parsePrincipal(reader, parentAddress, incExcType, USER, list);
                break;
            }
            default: {
                throw unexpectedElement(reader);
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:23,代码来源:AccessControlXml.java

示例7: parseSensitiveClassifications

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
private void parseSensitiveClassifications(final XMLExtendedStreamReader reader, final ModelNode address,
        final List<ModelNode> list) throws XMLStreamException {

    ParseUtils.requireNoAttributes(reader);

    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        requireNamespace(reader, namespace);
        final Element element = Element.forName(reader.getLocalName());
        switch (element) {
            case SENSITIVE_CLASSIFICATION: {
                parseSensitivityClassification(reader, address, list);
                break;
            }
            default: {
                throw unexpectedElement(reader);
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:20,代码来源:AccessControlXml.java

示例8: parseApplicationClassifications

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
private void parseApplicationClassifications(final XMLExtendedStreamReader reader, final ModelNode address,
        final List<ModelNode> list) throws XMLStreamException {

    ParseUtils.requireNoAttributes(reader);

    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        requireNamespace(reader, namespace);
        final Element element = Element.forName(reader.getLocalName());
        switch (element) {
            case APPLICATION_CLASSIFICATION: {
                parseApplicationClassification(reader, address, list);
                break;
            }
            default: {
                throw unexpectedElement(reader);
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:20,代码来源:AccessControlXml.java

示例9: readElement

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
    ParseUtils.requireNoAttributes(reader);
    ParseUtils.requireNoContent(reader);

    ModelNode subsystemAdd = Util.createAddOperation(PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, SUBSYSTEM_NAME)));
    subsystemAdd.get("test").set("Hello");
    subsystemAdd.get("properties", "one").set("A");
    subsystemAdd.get("properties", "two").set("B");

    list.add(subsystemAdd);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:13,代码来源:NewExtension.java

示例10: readElement

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
@Override
public void readElement(XMLExtendedStreamReader reader,
        List<ModelNode> ops) throws XMLStreamException {
    ParseUtils.requireNoAttributes(reader);
    ParseUtils.requireNoContent(reader);
    ops.add(Util.createAddOperation(PathAddress.pathAddress(CliExtCommandsSubsystemResourceDescription.PATH)));
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:8,代码来源:CliExtCommandsParser.java

示例11: readElement

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
    ParseUtils.requireNoAttributes(reader);
    ParseUtils.requireNoContent(reader);

    ModelNode subsystemAdd = Util.createAddOperation(PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, SUBSYSTEM_NAME)));
    subsystemAdd.get("test-attribute").set("This is only a test");
    list.add(subsystemAdd);

    addChildElements(list);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:12,代码来源:VersionedExtensionCommon.java

示例12: readElement

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> value) throws XMLStreamException {
    ParseUtils.requireNoAttributes(reader);
    ParseUtils.requireNoContent(reader);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:6,代码来源:EmptySubsystemParser.java

示例13: parseJvmOptions

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
private static void parseJvmOptions(final XMLExtendedStreamReader reader, final Namespace expectedNs, final ModelNode addOp)
        throws XMLStreamException {

    ModelNode options = new ModelNode();
    // Handle attributes
    ParseUtils.requireNoAttributes(reader);
    // Handle elements
    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        requireNamespace(reader, expectedNs);
        final Element element = Element.forName(reader.getLocalName());
        if (element == Element.OPTION) {
            // Handle attributes
            ModelNode option = null;
            final int count = reader.getAttributeCount();
            for (int i = 0; i < count; i++) {
                final String attrValue = reader.getAttributeValue(i);
                if (!isNoNamespaceAttribute(reader, i)) {
                    throw ParseUtils.unexpectedAttribute(reader, i);
                } else {
                    final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
                    switch (attribute) {
                        case VALUE: {
                            option = ParseUtils.parsePossibleExpression(attrValue);
                            break;
                        }
                        default:
                            throw ParseUtils.unexpectedAttribute(reader, i);
                    }
                }
            }
            if (option == null) {
                throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.NAME));
            }

            options.add(option);
            // Handle elements
            requireNoContent(reader);
        } else {
            throw unexpectedElement(reader);
        }
    }
    if (!options.isDefined()) {
        throw missingRequiredElement(reader, Collections.singleton(Element.OPTION));
    }
    addOp.get(JvmAttributes.JVM_OPTIONS).set(options);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:47,代码来源:JvmXml.java

示例14: readElement

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
@Override
public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> operations) throws XMLStreamException {
    // No attributes
    ParseUtils.requireNoAttributes(reader);

    // Subsystem add operation
    operations.add(Util.createAddOperation(SUBSYSTEM_ADDRESS));

    final List<ModelNode> loggerOperations = new ArrayList<>();
    final List<ModelNode> asyncHandlerOperations = new ArrayList<>();
    final List<ModelNode> handlerOperations = new ArrayList<>();

    // Elements
    final Set<String> loggerNames = new HashSet<>();
    final Set<String> handlerNames = new HashSet<>();
    boolean rootDefined = false;
    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        final Element element = Element.forName(reader.getLocalName());
        switch (element) {
            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;
            default: {
                reader.handleAny(operations);
                break;
            }
        }
    }
    operations.addAll(handlerOperations);
    operations.addAll(asyncHandlerOperations);
    operations.addAll(loggerOperations);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:73,代码来源:LoggingSubsystemParser_1_2.java

示例15: readElement

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
@Override
public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> operations) throws XMLStreamException {
    // No attributes
    ParseUtils.requireNoAttributes(reader);

    // Subsystem add operation
    operations.add(Util.createAddOperation(SUBSYSTEM_ADDRESS));

    final List<ModelNode> loggerOperations = new ArrayList<>();
    final List<ModelNode> asyncHandlerOperations = new ArrayList<>();
    final List<ModelNode> handlerOperations = new ArrayList<>();

    // Elements
    final Set<String> loggerNames = new HashSet<>();
    final Set<String> handlerNames = new HashSet<>();
    boolean rootDefined = false;
    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        final Element element = Element.forName(reader.getLocalName());
        switch (element) {
            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 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;
            }
            default: {
                reader.handleAny(operations);
                break;
            }
        }
    }

    operations.addAll(handlerOperations);
    operations.addAll(asyncHandlerOperations);
    operations.addAll(loggerOperations);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:63,代码来源:LoggingSubsystemParser_1_0.java


注:本文中的org.jboss.as.controller.parsing.ParseUtils.requireNoAttributes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。