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