本文整理汇总了Java中org.jboss.staxmapper.XMLExtendedStreamReader.next方法的典型用法代码示例。如果您正苦于以下问题:Java XMLExtendedStreamReader.next方法的具体用法?Java XMLExtendedStreamReader.next怎么用?Java XMLExtendedStreamReader.next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.staxmapper.XMLExtendedStreamReader
的用法示例。
在下文中一共展示了XMLExtendedStreamReader.next方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readElement
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
reader.next();
ModelNode add = new ModelNode();
add.get(OP).set(ADD);
add.get(OP_ADDR).set(PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, "test")).toModelNode());
list.add(add);
}
示例2: readElement
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
reader.next();
ModelNode add = new ModelNode();
add.get(OP).set(ADD);
add.get(OP_ADDR).set(PathAddress.pathAddress(SUBSYSTEM_PATH).toModelNode());
list.add(add);
}
示例3: readProperty
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
public static Property readProperty(final XMLExtendedStreamReader reader, boolean supportsExpressions) throws XMLStreamException {
final int cnt = reader.getAttributeCount();
String name = null;
ModelNode value = null;
for (int i = 0; i < cnt; i++) {
String uri = reader.getAttributeNamespace(i);
if (uri != null&&!"".equals(XMLConstants.NULL_NS_URI)) {
throw unexpectedAttribute(reader, i);
}
final String localName = reader.getAttributeLocalName(i);
if (localName.equals("name")) {
name = reader.getAttributeValue(i);
} else if (localName.equals("value")) {
if (supportsExpressions) {
value = parsePossibleExpression(reader.getAttributeValue(i));
} else {
value = new ModelNode(reader.getAttributeValue(i));
}
} else {
throw unexpectedAttribute(reader, i);
}
}
if (name == null) {
throw missingRequired(reader, Collections.singleton("name"));
}
if (reader.next() != END_ELEMENT) {
throw unexpectedElement(reader);
}
return new Property(name, new ModelNode().set(value == null ? new ModelNode() : value));
}