本文整理汇总了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);
}
示例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();
}
}
}
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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();
}
示例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();
}
示例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;
}