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


Java XMLExtendedStreamReader.getLocation方法代码示例

本文整理汇总了Java中org.jboss.staxmapper.XMLExtendedStreamReader.getLocation方法的典型用法代码示例。如果您正苦于以下问题:Java XMLExtendedStreamReader.getLocation方法的具体用法?Java XMLExtendedStreamReader.getLocation怎么用?Java XMLExtendedStreamReader.getLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.staxmapper.XMLExtendedStreamReader的用法示例。


在下文中一共展示了XMLExtendedStreamReader.getLocation方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readVaultElement_3_0

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
/**
 * In the 3.0 xsd the vault configuration and its options are part of the vault xsd.
 *
 * @param reader the reader at the vault element
 * @param expectedNs the namespace
 * @return the vault configuration
 */
static VaultConfig readVaultElement_3_0(XMLExtendedStreamReader reader, Namespace expectedNs) throws XMLStreamException {
    final VaultConfig config = new VaultConfig();

    final int count = reader.getAttributeCount();
    for (int i = 0; i < count; i++) {
        final String value = reader.getAttributeValue(i);
        String name = reader.getAttributeLocalName(i);
        if (name.equals(CODE)){
            config.code = value;
        } else if (name.equals(MODULE)){
            config.module = value;
        } else {
            unexpectedVaultAttribute(reader.getAttributeLocalName(i), reader);
        }
    }
    if (config.code == null && config.module != null){
        throw new XMLStreamException("Attribute 'module' was specified without an attribute"
                + " 'code' for element '" + VAULT + "' at " + reader.getLocation());
    }
    readVaultOptions(reader, config);
    return config;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:30,代码来源:VaultConfig.java

示例2: readElement

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
@Override
public void readElement(XMLExtendedStreamReader reader, VaultConfig config) throws XMLStreamException {

    String rootName = reader.getLocalName();
    if (VAULT.equals(rootName) == false) {
        throw new XMLStreamException("Unexpected element: " + rootName);
    }

    final int count = reader.getAttributeCount();
    for (int i = 0; i < count; i++) {
        final String value = reader.getAttributeValue(i);
        unexpectedVaultAttribute(reader.getAttributeLocalName(i), reader);
    }
    if (config.code == null && config.module != null){
        throw new XMLStreamException("Attribute 'module' was specified without an attribute"
                + " 'code' for element '" + VAULT + "' at " + reader.getLocation());
    }
    readVaultOptions(reader, config);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:20,代码来源:VaultConfig.java

示例3: readDefaultProtocol_2_0

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void readDefaultProtocol_2_0(XMLExtendedStreamReader reader, Namespace expectedNs, CliConfigImpl config)
        throws XMLStreamException {
    final int attributes = reader.getAttributeCount();
    for (int i = 0; i < attributes; i++) {
        String namespace = reader.getAttributeNamespace(i);
        String localName = reader.getAttributeLocalName(i);
        String value = reader.getAttributeValue(i);

        if (namespace != null && !namespace.equals("")) {
            throw new XMLStreamException("Unexpected attribute '" + namespace + ":" + localName + "'",
                    reader.getLocation());
        } else if (localName.equals(USE_LEGACY_OVERRIDE)) {
            config.useLegacyOverride = Boolean.parseBoolean(value);
        } else {
            throw new XMLStreamException("Unexpected attribute '" + localName + "'", reader.getLocation());
        }
    }

    final String resolved = resolveString(reader.getElementText());
    if (resolved != null && resolved.length() > 0) {
        config.defaultControllerProtocol = resolved;
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:24,代码来源:CliConfigImpl.java

示例4: readElement

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
@Override
public void readElement(final XMLExtendedStreamReader xmlExtendedStreamReader, final JBossAllXmlParseContext jBossXmlParseContext) throws XMLStreamException {
    final Location nsLocation = xmlExtendedStreamReader.getLocation();
    final QName elementName = xmlExtendedStreamReader.getName();
    final Object result = parserDescription.getParser().parse(xmlExtendedStreamReader, jBossXmlParseContext.getDeploymentUnit());
    jBossXmlParseContext.addResult(elementName, result, nsLocation);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:8,代码来源:JBossAllXMLElementReader.java

示例5: readControllers_2_0

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void readControllers_2_0(XMLExtendedStreamReader reader, Namespace expectedNs, CliConfigImpl config) throws XMLStreamException {
    Map<String, ControllerAddress> aliasedAddresses = new HashMap<String, ControllerAddress>();
    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        assertExpectedNamespace(reader, expectedNs);
        final String localName = reader.getLocalName();

        if (CONTROLLER.equals(localName)) {
            String name = null;
            final int attributes = reader.getAttributeCount();
            for (int i = 0; i < attributes; i++) {
                String namespace = reader.getAttributeNamespace(i);
                String attrLocalName = reader.getAttributeLocalName(i);
                String value = reader.getAttributeValue(i);

                if (namespace != null && !namespace.equals("")) {
                    throw new XMLStreamException("Unexpected attribute '" + namespace + ":" + attrLocalName + "'",
                            reader.getLocation());
                } else if (attrLocalName.equals(NAME) && name == null) {
                    name = value;
                } else {
                    throw new XMLStreamException("Unexpected attribute '" + attrLocalName + "'", reader.getLocation());
                }
            }

            if (name == null) {
                throw new XMLStreamException("Missing required attribute 'name'", reader.getLocation());
            }
            aliasedAddresses.put(name, readController(true, reader, expectedNs));
        } else {
            throw new XMLStreamException("Unexpected child of " + CONTROLLER + ": " + localName);
        }
    }

    config.controllerAliases = Collections.unmodifiableMap(aliasedAddresses);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:36,代码来源:CliConfigImpl.java

示例6: workerThreadPoolEndpointChoiceRequired

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private static XMLStreamException workerThreadPoolEndpointChoiceRequired(XMLExtendedStreamReader reader) {
    return new XMLStreamException(
            RemotingLogger.ROOT_LOGGER.workerThreadsEndpointConfigurationChoiceRequired(
                    Element.WORKER_THREAD_POOL.getLocalName(), Element.ENDPOINT.getLocalName()
            ), reader.getLocation());
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:7,代码来源:RemotingSubsystem20Parser.java

示例7: unexpectedElement

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
static void unexpectedElement(XMLExtendedStreamReader reader) throws XMLStreamException {
    throw new XMLStreamException("Unexpected element " + reader.getName() + " at " + reader.getLocation());
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:4,代码来源:CliConfigImpl.java

示例8: readElement

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
@Override
public void readElement(final XMLExtendedStreamReader reader, final ServerProvisioningDescription result) throws XMLStreamException {
    for (int i = 0; i < reader.getAttributeCount(); i++) {
        final Attribute attribute = Attribute.of(reader.getAttributeName(i));
        switch (attribute) {
            case COPY_MODULE_ARTIFACTS:
                result.setCopyModuleArtifacts(Boolean.parseBoolean(reader.getAttributeValue(i)));
                break;
            case EXTRACT_SCHEMAS:
                result.setExtractSchemas(Boolean.parseBoolean(reader.getAttributeValue(i)));
                break;
            case EXTRACT_SCHEMAS_GROUPS:
                result.setExtractSchemasGroups(reader.getAttributeValue(i));
                break;
            case EXCLUDE_DEPENDENCIES:
                result.setExcludeDependencies(Boolean.parseBoolean(reader.getAttributeValue(i)));
                break;
            default:
                throw ParsingUtils.unexpectedAttribute(reader, i);
        }
    }

    while (reader.hasNext()) {
        switch (reader.nextTag()) {
            case XMLStreamConstants.END_ELEMENT: {
                return;
            }
            case XMLStreamConstants.START_ELEMENT: {
                final Element element = Element.of(reader.getLocalName());

                switch (element) {
                    case FEATURE_PACKS:
                        parseFeaturePacks(reader, result);
                        break;
                    case VERSION_OVERRIDES:
                        parseVersionOverrides(reader, result);
                        break;
                    case COPY_ARTIFACTS:
                        copyArtifactsModelParser.parseCopyArtifacts(reader, result.getCopyArtifacts());
                        break;
                    default:
                        throw new XMLStreamException(String.format("Unknown element: '%s', elementName: %s, localName: %s", element, reader.getName(), reader.getLocalName()), reader.getLocation());
                        //throw ParsingUtils.unexpectedContent(reader);
                }
                break;
            }
            default: {
                throw ParsingUtils.unexpectedContent(reader);
            }
        }
    }
    throw ParsingUtils.endOfDocument(reader.getLocation());
}
 
开发者ID:wildfly,项目名称:wildfly-build-tools,代码行数:54,代码来源:ServerProvisioningDescriptionModelParser11.java

示例9: unexpectedAttribute

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
public static XMLStreamException unexpectedAttribute(final XMLExtendedStreamReader reader, final int index) {
    return new XMLStreamException(String.format("Unexpected attribute '%s' encountered", reader.getAttributeName(index)), reader.getLocation());

}
 
开发者ID:wildfly,项目名称:wildfly-build-tools,代码行数:5,代码来源:ParsingUtils.java


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