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


Java XMLExtendedStreamReader.handleAny方法代码示例

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


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

示例1: readElement

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

    ModelNode subsystemAddress = SubsystemExtension.createSubsystemAddress();

    list.add(SubsystemExtension.createAddSubsystemOperation(subsystemAddress));

    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        switch (Namespace.forUri(reader.getNamespaceURI())) {
            case LOGSTASH_GELF_1_0: {
                final Element element = Element.forName(reader.getLocalName());
                switch (element) {
                    case DATENPUMPE: {
                        SubsystemExtension.prepareOperation(ModelConstants.DATENPUMPE, reader, list, subsystemAddress);
                        ParseUtils.requireNoContent(reader);
                        break;
                    }

                    case SENDER: {
                        SubsystemExtension.prepareOperation(ModelConstants.SENDER, reader, list, subsystemAddress);
                        ParseUtils.requireNoContent(reader);
                        break;
                    }
                    default: {
                        reader.handleAny(list);
                        break;
                    }
                }
                break;
            }
            default:
                throw ParseUtils.unexpectedElement(reader);
        }
    }
}
 
开发者ID:mp911de,项目名称:logstash-gelf-subsystem,代码行数:40,代码来源:SubsystemParser.java

示例2: readElement

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的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

示例3: readElement

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的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;
            }
            default: {
                reader.handleAny(operations);
                break;
            }
        }
    }
    operations.addAll(handlerOperations);
    operations.addAll(asyncHandlerOperations);
    operations.addAll(loggerOperations);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:66,代码来源:LoggingSubsystemParser_1_1.java

示例4: readElement

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的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

示例5: parseJBossElement

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void parseJBossElement(final XMLExtendedStreamReader reader, final JBossAllXmlParseContext context) throws XMLStreamException {
    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        reader.handleAny(context);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:6,代码来源:JBossAllXMLParsingProcessor.java


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