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


Java XMLExtendedStreamReader类代码示例

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


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

示例1: parseUsersAuthentication

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseUsersAuthentication(final XMLExtendedStreamReader reader,
                                      final ModelNode realmAddress, final List<ModelNode> list)
        throws XMLStreamException {
    final ModelNode usersAddress = realmAddress.clone().add(AUTHENTICATION, USERS);
    list.add(Util.getEmptyOperation(ADD, usersAddress));

    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        requireNamespace(reader, namespace);
        final Element element = Element.forName(reader.getLocalName());
        switch (element) {
            case USER: {
                parseUser(reader, usersAddress, list);
                break;
            }
            default: {
                throw unexpectedElement(reader);
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:21,代码来源:ManagementXml_5.java

示例2: readElement

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
    PathAddress address = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, SmppExtension.SUBSYSTEM_NAME));

    final ModelNode subsystem = new ModelNode();
    subsystem.get(OP).set(ADD);
    subsystem.get(OP_ADDR).set(address.toModelNode());
    list.add(subsystem);

    // mbean elements
    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        switch (Namespace.forUri(reader.getNamespaceURI())) {
            case SMPPEXT_1_0: {
                final String tagName = reader.getLocalName();
                if (tagName.equals(SmppMbeanDefinition.MBEAN)) {
                    parseMbean(reader, address, list);
                }
                break;
            }
            default: {
                throw unexpectedElement(reader);
            }
        }
    }
}
 
开发者ID:RestComm,项目名称:smpp-extensions,代码行数:29,代码来源:SmppSubsystemParser.java

示例3: StandaloneXMLParser

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
public StandaloneXMLParser() {

        parserDelegate = new StandaloneXml(new ExtensionHandler() {
            @Override
            public void parseExtensions(XMLExtendedStreamReader reader, ModelNode address, Namespace namespace, List<ModelNode> list) throws XMLStreamException {
                reader.discardRemainder(); // noop
            }

            @Override
            public Set<ProfileParsingCompletionHandler> getProfileParsingCompletionHandlers() {
                return Collections.emptySet();
            }

            @Override
            public void writeExtensions(XMLExtendedStreamWriter writer, ModelNode modelNode) throws XMLStreamException {
                // noop
            }
        }, ParsingOption.IGNORE_SUBSYSTEM_FAILURES);

        xmlMapper = XMLMapper.Factory.create();

        addDelegate(new QName(Namespace.CURRENT.getUriString(), SERVER), parserDelegate);
        addDelegate(new QName("urn:jboss:domain:4.1", SERVER), parserDelegate);
        addDelegate(new QName("urn:jboss:domain:4.0", SERVER), parserDelegate);
        addDelegate(new QName("urn:jboss:domain:2.0", SERVER), parserDelegate);
    }
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:27,代码来源:StandaloneXMLParser.java

示例4: StandaloneXmlParser

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
public StandaloneXmlParser() {

        parserDelegate = new StandaloneXml(new ExtensionHandler() {
            @Override
            public void parseExtensions(XMLExtendedStreamReader reader, ModelNode address, Namespace namespace, List<ModelNode> list) throws XMLStreamException {
                reader.discardRemainder(); // noop
            }

            @Override
            public Set<ProfileParsingCompletionHandler> getProfileParsingCompletionHandlers() {
                return Collections.EMPTY_SET;
            }

            @Override
            public void writeExtensions(XMLExtendedStreamWriter writer, ModelNode modelNode) throws XMLStreamException {
                // noop
            }
        }, ParsingOption.IGNORE_SUBSYSTEM_FAILURES);

        xmlMapper = XMLMapper.Factory.create();
        xmlMapper.registerRootElement(new QName("urn:jboss:domain:4.0", "server"), parserDelegate);

    }
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:24,代码来源:StandaloneXmlParser.java

示例5: parseObjectReplicator

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private ModelNode parseObjectReplicator(XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException {
   	if (reader.getAttributeCount() > 0) {
   		for(int i=0; i<reader.getAttributeCount(); i++) {
   			String attrName = reader.getAttributeLocalName(i);
   			String attrValue = reader.getAttributeValue(i);
   			
   			Element element = Element.forName(attrName, Element.DISTRIBUTED_CACHE);
   			switch(element) {
   			case DC_STACK_ATTRIBUTE:
   				node.get(element.getModelName()).set(attrValue);
   				break;
               default: 
                   throw ParseUtils.unexpectedAttribute(reader, i);
   			}    			
   		}
   	}
       while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT));
   	return node;
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:20,代码来源:TeiidSubsystemParser.java

示例6: parsePg

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private ModelNode parsePg(XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException {
	if (reader.getAttributeCount() > 0) {
		for(int i=0; i<reader.getAttributeCount(); i++) {
			String attrName = reader.getAttributeLocalName(i);
			String attrValue = reader.getAttributeValue(i);
			Element element = Element.forName(attrName, Element.PG_ELEMENT);
			
			switch(element) {
			case PG_MAX_LOB_SIZE_ALLOWED_ELEMENT:
				node.get(element.getModelName()).set(attrValue);
				break;
			default:
				throw ParseUtils.unexpectedAttribute(reader, i);    			
			}
		}
	}
    while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT));
	return node;
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:20,代码来源:TeiidSubsystemParser.java

示例7: parseTruststore

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private ModelNode parseTruststore(XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException {
	if (reader.getAttributeCount() > 0) {
		for(int i=0; i<reader.getAttributeCount(); i++) {
			String attrName = reader.getAttributeLocalName(i);
			String attrValue = reader.getAttributeValue(i);
			Element element = Element.forName(attrName, Element.SSL_TRUSTSTORE_ELEMENT);
			
			switch(element) {
			case SSL_TRUSTSTORE_NAME_ATTRIBUTE:
				node.get(element.getModelName()).set(attrValue);
				break;
				
			case SSL_TRUSTSTORE_PASSWORD_ATTRIBUTE:
				node.get(element.getModelName()).setExpression(attrValue);
				break;
				
			default:
				throw ParseUtils.unexpectedAttribute(reader, i);    			
			}
		}
	}
    while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT));
	return node;
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:25,代码来源:TeiidSubsystemParser.java

示例8: parsePreparedPlanCacheConfiguration

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private ModelNode parsePreparedPlanCacheConfiguration(XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException {
	if (reader.getAttributeCount() > 0) {
		for(int i=0; i<reader.getAttributeCount(); i++) {
			String attrName = reader.getAttributeLocalName(i);
			String attrValue = reader.getAttributeValue(i);
			Element element = Element.forName(attrName, Element.PREPAREDPLAN_CACHE_ELEMENT);
			switch(element) {
			case PPC_CONTAINER_NAME_ELEMENT:
				node.get(element.getModelName()).set(attrValue);
				break;
			case PPC_ENABLE_ATTRIBUTE:
				node.get(element.getModelName()).set(Boolean.parseBoolean(attrValue));
				break;
			case PPC_NAME_ATTRIBUTE:
				node.get(element.getModelName()).set(attrValue);
				break;
			default: 
            	throw ParseUtils.unexpectedAttribute(reader, i);
			} 
		}
	}    	
    while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT));
	return node;
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:25,代码来源:TeiidSubsystemParser.java

示例9: parseTranslator

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private String parseTranslator(XMLExtendedStreamReader reader, ModelNode node) throws XMLStreamException {
	String translatorName = null;
	if (reader.getAttributeCount() > 0) {
		for(int i=0; i<reader.getAttributeCount(); i++) {
			String attrName = reader.getAttributeLocalName(i);
			String attrValue = reader.getAttributeValue(i);
			
			Element element = Element.forName(attrName);
			switch(element) {
			case TRANSPORT_NAME_ATTRIBUTE:
			case TRANSLATOR_NAME_ATTRIBUTE:
				translatorName = attrValue;
				break;
			case TRANSLATOR_MODULE_ATTRIBUTE:
				node.get(element.getModelName()).set(attrValue);
				break;
			default: 
            	throw ParseUtils.unexpectedAttribute(reader, i);
			}
		}
	}      	
	while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
		throw ParseUtils.unexpectedElement(reader);
	}
	return translatorName;
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:27,代码来源:TeiidSubsystemParser.java

示例10: parseSecurityConfigsElement

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
void parseSecurityConfigsElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {

        // Handle attributes
        requireNoAttributes(reader);

        // Handle module elements
        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            if (reader.getNamespaceURI().equals(SwitchYardExtension.NAMESPACE)) {
                final Element element = Element.forName(reader.getLocalName());
                if (element == Element.SECURITY_CONFIG) {
                    parseSecurityConfigElement(reader, list);
                } else {
                    throw unexpectedElement(reader);
                }
            }
        }
    }
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:18,代码来源:SwitchYardSubsystemReader.java

示例11: parseModulesElement

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
void parseModulesElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {

        // Handle attributes
        requireNoAttributes(reader);

        // Handle module elements
        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            if (reader.getNamespaceURI().equals(SwitchYardExtension.NAMESPACE)) {
                final Element element = Element.forName(reader.getLocalName());
                if (element == Element.MODULE) {
                    parseModuleElement(reader, list);
                } else {
                    throw unexpectedElement(reader);
                }
            }
        }
    }
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:18,代码来源:SwitchYardSubsystemReader.java

示例12: parseExtensionsElement

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
void parseExtensionsElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {

        // Handle attributes
        requireNoAttributes(reader);

        // Handle module elements
        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            if (reader.getNamespaceURI().equals(SwitchYardExtension.NAMESPACE)) {
                final Element element = Element.forName(reader.getLocalName());
                if (element == Element.EXTENSION) {
                    parseExtensionElement(reader, list);
                } else {
                    throw unexpectedElement(reader);
                }
            }
        }
    }
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:18,代码来源:SwitchYardSubsystemReader.java

示例13: parseRemoteDomainController_1_5

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseRemoteDomainController_1_5(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list) throws XMLStreamException {

        parseRemoteDomainControllerAttributes_1_5(reader, address, list, false);

        Set<String> types = new HashSet<String>();
        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            requireNamespace(reader, namespace);
            final Element element = Element.forName(reader.getLocalName());
            switch (element) {
                case IGNORED_RESOURCE: {
                    parseIgnoredResource(reader, address, list, types);
                    break;
                }
                default:
                    throw unexpectedElement(reader);
            }
        }
    }
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:19,代码来源:HostXml_Legacy.java

示例14: 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

示例15: parseKerberosAuthentication

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入依赖的package包/类
private void parseKerberosAuthentication(final XMLExtendedStreamReader reader,
        final ModelNode realmAddress, final List<ModelNode> list) throws XMLStreamException {
    ModelNode addr = realmAddress.clone().add(AUTHENTICATION, KERBEROS);
    ModelNode kerberos = Util.getEmptyOperation(ADD, addr);
    list.add(kerberos);

    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 REMOVE_REALM:
                    KerberosAuthenticationResourceDefinition.REMOVE_REALM.parseAndSetParameter(value, kerberos, reader);
                    break;
                default: {
                    throw unexpectedAttribute(reader, i);
                }
            }
        }
    }

    requireNoContent(reader);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:27,代码来源:ManagementXml_5.java


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