本文整理汇总了Java中org.jboss.staxmapper.XMLExtendedStreamReader.getListAttributeValue方法的典型用法代码示例。如果您正苦于以下问题:Java XMLExtendedStreamReader.getListAttributeValue方法的具体用法?Java XMLExtendedStreamReader.getListAttributeValue怎么用?Java XMLExtendedStreamReader.getListAttributeValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.staxmapper.XMLExtendedStreamReader
的用法示例。
在下文中一共展示了XMLExtendedStreamReader.getListAttributeValue方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseSchemaLocations
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
protected void parseSchemaLocations(final XMLExtendedStreamReader reader, final ModelNode address,
final List<ModelNode> updateList, final int idx) throws XMLStreamException {
final List<String> elements = reader.getListAttributeValue(idx);
final List<String> values = new ArrayList<String>();
for (String element : elements) {
if (!element.trim().isEmpty()) {
values.add(element);
}
}
if ((values.size() & 1) != 0) {
throw invalidAttributeValue(reader, idx);
}
final Iterator<String> it = values.iterator();
while (it.hasNext()) {
String key = it.next();
String val = it.next();
if (key.length() > 0 && val.length() > 0) {
updateList.add(SchemaLocationAddHandler.getAddSchemaLocationOperation(address, key, val));
}
}
}
示例2: parseKeyTab
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void parseKeyTab(final XMLExtendedStreamReader reader,
final ModelNode parentAddress, final List<ModelNode> list) throws XMLStreamException {
ModelNode keytab = new ModelNode();
keytab.get(OP).set(ADD);
list.add(keytab);
Set<Attribute> requiredAttributes = EnumSet.of(Attribute.PRINCIPAL, Attribute.PATH);
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
if (!isNoNamespaceAttribute(reader, i)) {
throw unexpectedAttribute(reader, i);
} else {
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
requiredAttributes.remove(attribute);
switch (attribute) {
case PRINCIPAL:
keytab.get(OP_ADDR).set(parentAddress).add(KEYTAB, value);
break;
case PATH:
KeytabResourceDefinition.PATH.parseAndSetParameter(value, keytab, reader);
break;
case RELATIVE_TO:
KeytabResourceDefinition.RELATIVE_TO.parseAndSetParameter(value, keytab, reader);
break;
case FOR_HOSTS:
for (String host : reader.getListAttributeValue(i)) {
KeytabResourceDefinition.FOR_HOSTS.parseAndAddParameterElement(host, keytab, reader);
}
break;
case DEBUG:
KeytabResourceDefinition.DEBUG.parseAndSetParameter(value, keytab, reader);
break;
default:
throw unexpectedAttribute(reader, i);
}
}
}
// This would pick up if the address for the operation has not yet been set.
if (requiredAttributes.isEmpty() == false) {
throw missingRequired(reader, requiredAttributes);
}
requireNoContent(reader);
}
示例3: parseHttpManagementInterfaceAttributes
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void parseHttpManagementInterfaceAttributes(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException {
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
if (!isNoNamespaceAttribute(reader, i)) {
throw unexpectedAttribute(reader, i);
} else {
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case HTTP_AUTHENTICATION_FACTORY: {
HttpManagementResourceDefinition.HTTP_AUTHENTICATION_FACTORY.parseAndSetParameter(value, addOp, reader);
break;
}
case SASL_PROTOCOL: {
HttpManagementResourceDefinition.SASL_PROTOCOL.parseAndSetParameter(value, addOp, reader);
break;
}
case SECURITY_REALM: {
HttpManagementResourceDefinition.SECURITY_REALM.parseAndSetParameter(value, addOp, reader);
break;
}
case SERVER_NAME: {
HttpManagementResourceDefinition.SERVER_NAME.parseAndSetParameter(value, addOp, reader);
break;
}
case SSL_CONTEXT: {
HttpManagementResourceDefinition.SSL_CONTEXT.parseAndSetParameter(value, addOp, reader);
break;
}
case CONSOLE_ENABLED: {
HttpManagementResourceDefinition.CONSOLE_ENABLED.parseAndSetParameter(value, addOp, reader);
break;
}
case HTTP_UPGRADE_ENABLED: {
ModelNode httpUpgrade = addOp.get(HTTP_UPGRADE);
HttpManagementResourceDefinition.ENABLED.parseAndSetParameter(value, httpUpgrade, reader);
break;
}
case ALLOWED_ORIGINS: {
for (String origin : reader.getListAttributeValue(i)) {
HttpManagementResourceDefinition.ALLOWED_ORIGINS.parseAndAddParameterElement(origin, addOp, reader);
}
break;
}
default:
throw unexpectedAttribute(reader, i);
}
}
}
}
示例4: parseHttpManagementInterfaceAttributes_3_0
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void parseHttpManagementInterfaceAttributes_3_0(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException {
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
if (!isNoNamespaceAttribute(reader, i)) {
throw unexpectedAttribute(reader, i);
} else {
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case SASL_PROTOCOL: {
HttpManagementResourceDefinition.SASL_PROTOCOL.parseAndSetParameter(value, addOp, reader);
break;
}
case SECURITY_REALM: {
HttpManagementResourceDefinition.SECURITY_REALM.parseAndSetParameter(value, addOp, reader);
break;
}
case SERVER_NAME: {
NativeManagementResourceDefinition.SERVER_NAME.parseAndSetParameter(value, addOp, reader);
break;
}
case CONSOLE_ENABLED: {
HttpManagementResourceDefinition.CONSOLE_ENABLED.parseAndSetParameter(value, addOp, reader);
break;
}
case HTTP_UPGRADE_ENABLED: {
ModelNode httpUpgrade = addOp.get(HTTP_UPGRADE);
HttpManagementResourceDefinition.ENABLED.parseAndSetParameter(value, httpUpgrade, reader);
break;
}
case ALLOWED_ORIGINS: {
for (String origin : reader.getListAttributeValue(i)) {
HttpManagementResourceDefinition.ALLOWED_ORIGINS.parseAndAddParameterElement(origin, addOp, reader);
}
break;
}
default:
throw unexpectedAttribute(reader, i);
}
}
}
}
示例5: parseHttpManagementInterfaceAttributes
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void parseHttpManagementInterfaceAttributes(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException {
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
if (!isNoNamespaceAttribute(reader, i)) {
throw unexpectedAttribute(reader, i);
} else {
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case SASL_PROTOCOL: {
HttpManagementResourceDefinition.SASL_PROTOCOL.parseAndSetParameter(value, addOp, reader);
break;
}
case SECURITY_REALM: {
HttpManagementResourceDefinition.SECURITY_REALM.parseAndSetParameter(value, addOp, reader);
break;
}
case SERVER_NAME: {
NativeManagementResourceDefinition.SERVER_NAME.parseAndSetParameter(value, addOp, reader);
break;
}
case CONSOLE_ENABLED: {
HttpManagementResourceDefinition.CONSOLE_ENABLED.parseAndSetParameter(value, addOp, reader);
break;
}
case HTTP_UPGRADE_ENABLED: {
ModelNode httpUpgrade = addOp.get(HTTP_UPGRADE);
HttpManagementResourceDefinition.ENABLED.parseAndSetParameter(value, httpUpgrade, reader);
break;
}
case ALLOWED_ORIGINS: {
for (String origin : reader.getListAttributeValue(i)) {
HttpManagementResourceDefinition.ALLOWED_ORIGINS.parseAndAddParameterElement(origin, addOp, reader);
}
break;
}
default:
throw unexpectedAttribute(reader, i);
}
}
}
}
示例6: parseHttpManagementInterfaceAttributes
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void parseHttpManagementInterfaceAttributes(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException {
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
if (!isNoNamespaceAttribute(reader, i)) {
throw unexpectedAttribute(reader, i);
} else {
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case HTTP_AUTHENTICATION_FACTORY: {
HttpManagementResourceDefinition.HTTP_AUTHENTICATION_FACTORY.parseAndSetParameter(value, addOp, reader);
break;
}
case SASL_PROTOCOL: {
HttpManagementResourceDefinition.SASL_PROTOCOL.parseAndSetParameter(value, addOp, reader);
break;
}
case SECURITY_REALM: {
HttpManagementResourceDefinition.SECURITY_REALM.parseAndSetParameter(value, addOp, reader);
break;
}
case SERVER_NAME: {
HttpManagementResourceDefinition.SERVER_NAME.parseAndSetParameter(value, addOp, reader);
break;
}
case SSL_CONTEXT: {
HttpManagementResourceDefinition.SSL_CONTEXT.parseAndSetParameter(value, addOp, reader);
break;
}
case CONSOLE_ENABLED: {
HttpManagementResourceDefinition.CONSOLE_ENABLED.parseAndSetParameter(value, addOp, reader);
break;
}
case ALLOWED_ORIGINS: {
for (String origin : reader.getListAttributeValue(i)) {
HttpManagementResourceDefinition.ALLOWED_ORIGINS.parseAndAddParameterElement(origin, addOp, reader);
}
break;
}
default:
throw unexpectedAttribute(reader, i);
}
}
}
}
示例7: parseHttpManagementInterfaceAttributes
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void parseHttpManagementInterfaceAttributes(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException {
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
if (!isNoNamespaceAttribute(reader, i)) {
throw unexpectedAttribute(reader, i);
} else {
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case SASL_PROTOCOL: {
HttpManagementResourceDefinition.SASL_PROTOCOL.parseAndSetParameter(value, addOp, reader);
break;
}
case SECURITY_REALM: {
HttpManagementResourceDefinition.SECURITY_REALM.parseAndSetParameter(value, addOp, reader);
break;
}
case SERVER_NAME: {
HttpManagementResourceDefinition.SERVER_NAME.parseAndSetParameter(value, addOp, reader);
break;
}
case CONSOLE_ENABLED: {
HttpManagementResourceDefinition.CONSOLE_ENABLED.parseAndSetParameter(value, addOp, reader);
break;
}
case HTTP_UPGRADE_ENABLED: {
ModelNode httpUpgrade = addOp.get(HTTP_UPGRADE);
HttpManagementResourceDefinition.ENABLED.parseAndSetParameter(value, httpUpgrade, reader);
break;
}
case ALLOWED_ORIGINS: {
for (String origin : reader.getListAttributeValue(i)) {
HttpManagementResourceDefinition.ALLOWED_ORIGINS.parseAndAddParameterElement(origin, addOp, reader);
}
break;
}
default:
throw unexpectedAttribute(reader, i);
}
}
}
}
示例8: parseHttpManagementInterfaceAttributes3_0
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void parseHttpManagementInterfaceAttributes3_0(XMLExtendedStreamReader reader,ModelNode addOp) throws XMLStreamException {
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
if (!isNoNamespaceAttribute(reader, i)) {
throw unexpectedAttribute(reader, i);
} else {
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case SASL_PROTOCOL: {
HttpManagementResourceDefinition.SASL_PROTOCOL.parseAndSetParameter(value, addOp, reader);
break;
}
case SECURITY_REALM: {
HttpManagementResourceDefinition.SECURITY_REALM.parseAndSetParameter(value, addOp, reader);
break;
}
case SERVER_NAME: {
HttpManagementResourceDefinition.SERVER_NAME.parseAndSetParameter(value, addOp, reader);
break;
}
case CONSOLE_ENABLED: {
HttpManagementResourceDefinition.CONSOLE_ENABLED.parseAndSetParameter(value, addOp, reader);
break;
}
case HTTP_UPGRADE_ENABLED: {
ModelNode httpUpgrade = addOp.get(HTTP_UPGRADE);
HttpManagementResourceDefinition.ENABLED.parseAndSetParameter(value, httpUpgrade, reader);
break;
}
case ALLOWED_ORIGINS: {
for (String origin : reader.getListAttributeValue(i)) {
HttpManagementResourceDefinition.ALLOWED_ORIGINS.parseAndAddParameterElement(origin, addOp, reader);
}
break;
}
default:
throw unexpectedAttribute(reader, i);
}
}
}
}
示例9: readListAttributeElement
import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
/**
* Read an element which contains only a single list attribute of a given
* type.
* @param reader the reader
* @param attributeName the attribute name, usually "value"
* @param type the value type class
* @param <T> the value type
* @return the value list
* @throws javax.xml.stream.XMLStreamException if an error occurs or if the
* element does not contain the specified attribute, contains other
* attributes, or contains child elements.
*/
@SuppressWarnings({ "unchecked" })
public static <T> List<T> readListAttributeElement(final XMLExtendedStreamReader reader, final String attributeName,
final Class<T> type) throws XMLStreamException {
requireSingleAttribute(reader, attributeName);
// todo: fix this when this method signature is corrected
final List<T> value = (List<T>) reader.getListAttributeValue(0, type);
requireNoContent(reader);
return value;
}