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


Java XMLElementReader类代码示例

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


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

示例1: configureFractionsFromXML

import org.jboss.staxmapper.XMLElementReader; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void configureFractionsFromXML(Container container, List<ModelNode> operationList) throws Exception {

    StandaloneXmlParser parser = new StandaloneXmlParser();

    FractionProcessor<StandaloneXmlParser> consumer = (p, cfg, fraction) -> {
        try {
            if (cfg.getSubsystemParsers().isPresent()) {
                Map<QName, XMLElementReader<List<ModelNode>>> fractionParsers =
                        (Map<QName, XMLElementReader<List<ModelNode>>>) cfg.getSubsystemParsers().get();

                fractionParsers.forEach(p::addDelegate);
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    };

    // collect parsers
    visitFractions(container, parser, consumer);

    // parse the configurations
    List<ModelNode> parseResult = parser.parse(xmlConfig.get());
    operationList.addAll(parseResult);

}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:27,代码来源:RuntimeServer.java

示例2: setSubsystemXmlMapping

import org.jboss.staxmapper.XMLElementReader; //导入依赖的package包/类
@Override
public void setSubsystemXmlMapping(String subsystemName, String namespaceUri, XMLElementReader<List<ModelNode>> reader) {
    assert subsystemName != null : "subsystemName is null";
    assert namespaceUri != null : "namespaceUri is null";
    synchronized (extension) {
        extension.getSubsystemInfo(subsystemName).addParsingNamespace(namespaceUri);
        if (extension.xmlMapper != null) {
            extension.xmlMapper.registerRootElement(new QName(namespaceUri, SUBSYSTEM), reader);
            if (reader instanceof PersistentResourceXMLParser) {
                // In a standard WildFly boot this method is being called as part of concurrent
                // work on multiple extensions. Generating the PersistentResourceXMLDescription
                // used by PersistentResourceXMLParser involves a lot of classloading and static
                // field initialization that can benefit by being done as part of this concurrent
                // work instead of being deferred to the single-threaded parsing phase. So, we ask
                // the parser to generate and cache that description for later use during parsing.
                //noinspection deprecation
                ((PersistentResourceXMLParser) reader).cacheXMLDescription();
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:ExtensionRegistry.java

示例3: deploy

import org.jboss.staxmapper.XMLElementReader; //导入依赖的package包/类
@Deployment
public static JavaArchive deploy() throws Exception {
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "beans.jar");
    jar.addPackage(StatefulTestBean.class.getPackage());
    jar.addClasses(MgmtOperationException.class);
    jar.addClasses(CustomModuleTestCase.class, MgmtOperationException.class, XMLElementReader.class,
            XMLElementWriter.class, AbstractMgmtTestBase.class, ContainerResourceMgmtTestBase.class)
            .addAsManifestResource(
                    new StringAsset(
                            "Dependencies: org.jboss.as.controller-client,org.jboss.dmr,org.jboss.as.cli \n"),
                    "MANIFEST.MF");
    return jar;
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:14,代码来源:CustomModuleTestCase.java

示例4: create

import org.jboss.staxmapper.XMLElementReader; //导入依赖的package包/类
@Override
public Map<QName, XMLElementReader<List<ModelNode>>> create() {
    ParsingContext ctx = new ParsingContext();
    SecurityExtension ext = new SecurityExtension();
    ext.initializeParsers(ctx);
    return ctx.getParser();
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:8,代码来源:SecurityParserFactory.java

示例5: create

import org.jboss.staxmapper.XMLElementReader; //导入依赖的package包/类
@Override
public Map<QName, XMLElementReader<List<ModelNode>>> create() {
    ParsingContext ctx = new ParsingContext();
    EeExtension ext = new EeExtension();
    ext.initializeParsers(ctx);
    return ctx.getParser();
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:8,代码来源:EEParserFactory.java

示例6: create

import org.jboss.staxmapper.XMLElementReader; //导入依赖的package包/类
@Override
public Map<QName, XMLElementReader<List<ModelNode>>> create() {
    ParsingContext ctx = new ParsingContext();
    DataSourcesExtension ext = new DataSourcesExtension();
    ext.initializeParsers(ctx);
    return ctx.getParser();
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:8,代码来源:DatasourceParserFactory.java

示例7: create

import org.jboss.staxmapper.XMLElementReader; //导入依赖的package包/类
public Map<QName, XMLElementReader<List<ModelNode>>> create() {

        ParsingContext ctx = new ParsingContext();
        LoggingExtension ext = new LoggingExtension();
        ext.initializeParsers(ctx);
        return ctx.getParser();
    }
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:8,代码来源:LoggingParserFactory.java

示例8: create

import org.jboss.staxmapper.XMLElementReader; //导入依赖的package包/类
@Override
public Map<QName, XMLElementReader<List<ModelNode>>> create() {
    ParsingContext ctx = new ParsingContext();
    NamingExtension ext = new NamingExtension();
    ext.initializeParsers(ctx);
    return ctx.getParser();
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:8,代码来源:NamingParserFactory.java

示例9: create

import org.jboss.staxmapper.XMLElementReader; //导入依赖的package包/类
@Override
public Map<QName, XMLElementReader<List<ModelNode>>> create() {
    ParsingContext ctx = new ParsingContext();
    RemotingExtension ext = new RemotingExtension();
    ext.initializeParsers(ctx);
    return ctx.getParser();
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:8,代码来源:RemotingParserFactory.java

示例10: create

import org.jboss.staxmapper.XMLElementReader; //导入依赖的package包/类
@Override
public Map<QName, XMLElementReader<List<ModelNode>>> create() {
    ParsingContext ctx = new ParsingContext();
    JcaExtension ext = new JcaExtension();
    ext.initializeParsers(ctx);
    return ctx.getParser();
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:8,代码来源:JCAParserFactory.java

示例11: create

import org.jboss.staxmapper.XMLElementReader; //导入依赖的package包/类
@Override
public Map<QName, XMLElementReader<List<ModelNode>>> create() {
    ParsingContext ctx = new ParsingContext();
    UndertowExtension ext = new UndertowExtension();
    ext.initializeParsers(ctx);
    return ctx.getParser();
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:8,代码来源:UndertowParserFactory.java

示例12: mapParserNamespaces

import org.jboss.staxmapper.XMLElementReader; //导入依赖的package包/类
/**
 * Parsers retain the namespace, but the local part becomes 'subsystem'
 *
 * @param factory the factory producing the parsers
 * @return
 */
public static Optional<Map<QName, XMLElementReader<List<ModelNode>>>> mapParserNamespaces(AbstractParserFactory factory) {
    Map<QName, XMLElementReader<List<ModelNode>>> result =
            factory.create().entrySet()
                    .stream()
                    .collect(Collectors.toMap(
                            e -> new QName(e.getKey().getNamespaceURI(), SUBSYSTEM),
                            e -> e.getValue()
                    ));

    return Optional.of(result);
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:18,代码来源:AbstractParserFactory.java

示例13: create

import org.jboss.staxmapper.XMLElementReader; //导入依赖的package包/类
@Override
public Map<QName, XMLElementReader<List<ModelNode>>> create() {
    ParsingContext ctx = new ParsingContext();
    JaxrsExtension ext = new JaxrsExtension();
    ext.initializeParsers(ctx);
    return ctx.getParser();

}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:9,代码来源:JAXRSParserFactory.java

示例14: create

import org.jboss.staxmapper.XMLElementReader; //导入依赖的package包/类
@Override
public Map<QName, XMLElementReader<List<ModelNode>>> create() {
    ParsingContext ctx = new ParsingContext();
    IOExtension ext = new IOExtension();
    ext.initializeParsers(ctx);
    return ctx.getParser();
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:8,代码来源:IOParserFactory.java

示例15: xmlToModelOperations

import org.jboss.staxmapper.XMLElementReader; //导入依赖的package包/类
public static List<ModelNode> xmlToModelOperations(String xml, String nameSpaceUriString, XMLElementReader<List<ModelNode>> parser) throws Exception {
    XMLMapper mapper = XMLMapper.Factory.create();
    mapper.registerRootElement(new QName(nameSpaceUriString, "subsystem"), parser);

    StringReader strReader = new StringReader(xml);

    XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StreamSource(strReader));
    List<ModelNode> newList = new ArrayList<ModelNode>();
    mapper.parseDocument(newList, reader);

    return newList;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:13,代码来源:AbstractMgmtTestBase.java


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