本文整理汇总了Java中org.jboss.as.controller.parsing.ParseUtils.readStringAttributeElement方法的典型用法代码示例。如果您正苦于以下问题:Java ParseUtils.readStringAttributeElement方法的具体用法?Java ParseUtils.readStringAttributeElement怎么用?Java ParseUtils.readStringAttributeElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.as.controller.parsing.ParseUtils
的用法示例。
在下文中一共展示了ParseUtils.readStringAttributeElement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseIgnoredResource
import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
private void parseIgnoredResource(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list, final Set<String> foundTypes) throws XMLStreamException {
ModelNode op = new ModelNode();
op.get(OP).set(ADD);
String type = null;
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
if (!isNoNamespaceAttribute(reader, i)) {
throw unexpectedAttribute(reader, i);
}
final String value = reader.getAttributeValue(i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case TYPE: {
if (!foundTypes.add(value)) {
throw HostControllerLogger.ROOT_LOGGER.duplicateIgnoredResourceType(Element.IGNORED_RESOURCE.getLocalName(), value, reader.getLocation());
}
type = value;
break;
}
case WILDCARD: {
IgnoredDomainTypeResourceDefinition.WILDCARD.parseAndSetParameter(value, op, reader);
break;
}
default:
throw unexpectedAttribute(reader, i);
}
}
if (type == null) {
throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.TYPE.getLocalName()));
}
ModelNode addr = op.get(OP_ADDR).set(address);
addr.add(CORE_SERVICE, IGNORED_RESOURCES);
addr.add(IGNORED_RESOURCE_TYPE, type);
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
requireNamespace(reader, namespace);
final Element element = Element.forName(reader.getLocalName());
switch (element) {
case INSTANCE: {
String name = ParseUtils.readStringAttributeElement(reader, NAME);
IgnoredDomainTypeResourceDefinition.NAMES.parseAndAddParameterElement(name, op, reader);
break;
}
default:
throw unexpectedElement(reader);
}
}
list.add(op);
}