当前位置: 首页>>代码示例>>Java>>正文


Java XMLExtendedStreamReader.getListAttributeValue方法代码示例

本文整理汇总了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));
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:CommonXml.java

示例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);

}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:50,代码来源:ManagementXml_4.java

示例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);
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:51,代码来源:HostXml_6.java

示例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);
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:43,代码来源:HostXml_Legacy.java

示例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);
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:43,代码来源:HostXml_4.java

示例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);
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:46,代码来源:StandaloneXml_5.java

示例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);
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:43,代码来源:StandaloneXml_4.java

示例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);
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:43,代码来源:StandaloneXml_Legacy.java

示例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;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:ParseUtils.java


注:本文中的org.jboss.staxmapper.XMLExtendedStreamReader.getListAttributeValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。