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


Java XMLExtendedStreamReader.getAttributeValue方法代码示例

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


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

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

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

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

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

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

示例6: readElement

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
    // The "enabled" attribute is required
    ParseUtils.requireAttributes(reader, NEST_ENABLED_ATTR);

    // Add the main subsystem 'add' operation
    final ModelNode opAdd = new ModelNode();
    opAdd.get(OP).set(ADD);
    opAdd.get(OP_ADDR).set(PathAddress.pathAddress(SUBSYSTEM_PATH).toModelNode());
    String brokerEnabledValue = reader.getAttributeValue(null, NEST_ENABLED_ATTR);
    if (brokerEnabledValue != null) {
        opAdd.get(NEST_ENABLED_ATTR).set(new ValueExpression(brokerEnabledValue));
    }

    // Read the children elements
    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        String elementName = reader.getLocalName();
        if (elementName.equals(CUSTOM_CONFIG_ELEMENT)) {
            ModelNode configAttributeNode = opAdd.get(CUSTOM_CONFIG_ELEMENT);
            while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
                if (reader.isStartElement()) {
                    readCustomConfigurationProperty(reader, configAttributeNode);
                }
            }
        } else if (elementName.equals(NEST_NAME_ELEMENT)) {
            opAdd.get(NEST_NAME_ELEMENT).set(new ValueExpression(reader.getElementText()));
        } else {
            throw ParseUtils.unexpectedElement(reader);
        }
    }

    list.add(opAdd);
}
 
开发者ID:hawkular,项目名称:hawkular-commons,代码行数:34,代码来源:NestSubsystemExtension.java

示例7: readCustomConfigurationProperty

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void readCustomConfigurationProperty(XMLExtendedStreamReader reader, ModelNode configAttributeNode)
        throws XMLStreamException {
    if (!reader.getLocalName().equals(PROPERTY_ELEMENT)) {
        throw ParseUtils.unexpectedElement(reader);
    }

    ParseUtils.requireAttributes(reader, Attribute.NAME.getLocalName(), Attribute.VALUE.getLocalName());
    String attr = reader.getAttributeValue(null, Attribute.NAME.getLocalName());
    String val = reader.getAttributeValue(null, Attribute.VALUE.getLocalName());
    ParseUtils.requireNoContent(reader);

    configAttributeNode.add(attr, val);
}
 
开发者ID:hawkular,项目名称:hawkular-commons,代码行数:14,代码来源:NestSubsystemExtension.java

示例8: parseAuthentication

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private ModelNode parseAuthentication(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.AUTHENTICATION_ELEMENT);
			
			switch(element) {
			case AUTHENTICATION_SECURITY_DOMAIN_ATTRIBUTE:
				node.get(element.getModelName()).set(attrValue);
				break;
			case AUTHENTICATION_KRB5_DOMAIN_ATTRIBUTE:
				node.get(element.getModelName()).set(attrValue);
				break;
			case AUTHENTICATION_TYPE_ATTRIBUTE:
				node.get(element.getModelName()).set(attrValue);
				break;
				
			case AUTHENTICATION_MAX_SESSIONS_ALLOWED_ATTRIBUTE:
				node.get(element.getModelName()).set(Integer.parseInt(attrValue));
				break;
				
			case AUTHENTICATION_SESSION_EXPIRATION_TIME_LIMIT_ATTRIBUTE:
				node.get(element.getModelName()).set(Integer.parseInt(attrValue));
				break;

			default:
				throw ParseUtils.unexpectedAttribute(reader, i);    			
			}
		}
	}
    while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT));
	return node;
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:35,代码来源:TeiidSubsystemParser.java

示例9: parseKeystore

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private ModelNode parseKeystore(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_KETSTORE_ELEMENT);
			
			switch(element) {
			case SSL_KETSTORE_NAME_ATTRIBUTE:
				node.get(element.getModelName()).set(attrValue);
				break;
				
			case SSL_KETSTORE_PASSWORD_ATTRIBUTE:
				node.get(element.getModelName()).setExpression(attrValue);
				break;
				
			case SSL_KETSTORE_TYPE_ATTRIBUTE:
				node.get(element.getModelName()).set(attrValue);
				break;

			case SSL_KETSTORE_ALIAS_ATTRIBUTE:
				node.get(element.getModelName()).set(attrValue);
				break;
				
			case SSL_KETSTORE_KEY_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,代码行数:37,代码来源:TeiidSubsystemParser.java

示例10: parseResultsetCacheConfiguration

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private ModelNode parseResultsetCacheConfiguration(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.RESULTSET_CACHE_ELEMENT);
			switch(element) {
			case RSC_CONTAINER_NAME_ATTRIBUTE:
				node.get(element.getModelName()).set(attrValue);
				break;
			case RSC_ENABLE_ATTRIBUTE:
				node.get(element.getModelName()).set(Boolean.parseBoolean(attrValue));
				break;
			case RSC_MAX_STALENESS_ATTRIBUTE:
				node.get(element.getModelName()).set(Integer.parseInt(attrValue));
				break;
			case RSC_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,代码行数:28,代码来源:TeiidSubsystemParser.java

示例11: parseSecurityConfigElement

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
void parseSecurityConfigElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
    String identifier = null;
    final int count = reader.getAttributeCount();
    for (int i = 0; i < count; i++) {
        requireNoNamespaceAttribute(reader, i);
        final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
        switch (attribute) {
            case IDENTIFIER:
                identifier = reader.getAttributeValue(i);
                break;
            default:
                throw unexpectedAttribute(reader, i);
        }
    }
    if (identifier == null) {
        throw missingRequired(reader, Collections.singleton(Attribute.IDENTIFIER));
    }

    //Add the 'add' operation for each 'security-config' child
    ModelNode securityConfigAdd = new ModelNode();
    securityConfigAdd.get(OP).set(ModelDescriptionConstants.ADD);
    PathAddress addr = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, SwitchYardExtension.SUBSYSTEM_NAME), PathElement.pathElement(SECURITY_CONFIG, identifier));
    securityConfigAdd.get(OP_ADDR).set(addr.toModelNode());

    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        final Element element1 = Element.forName(reader.getLocalName());
        switch (element1) {
            case PROPERTIES: 
                ModelNode properties = parsePropertiesElement(identifier, reader);
                if (properties != null) {
                    securityConfigAdd.get(PROPERTIES).set(properties);
                }
                break;
            default:
                throw unexpectedElement(reader);
        }
    }

    list.add(securityConfigAdd);
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:41,代码来源:SwitchYardSubsystemReader.java

示例12: parseExtensionElement

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
void parseExtensionElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
    String identifier = null;
    final int count = reader.getAttributeCount();
    for (int i = 0; i < count; i++) {
        requireNoNamespaceAttribute(reader, i);
        final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
        switch (attribute) {
            case IDENTIFIER:
                identifier = reader.getAttributeValue(i);
                break;
            default:
                throw unexpectedAttribute(reader, i);
        }
    }
    if (identifier == null) {
        throw missingRequired(reader, Collections.singleton(Attribute.IDENTIFIER));
    }

    //Add the 'add' operation for each 'module' child
    ModelNode moduleAdd = new ModelNode();
    moduleAdd.get(OP).set(ModelDescriptionConstants.ADD);
    PathAddress addr = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, SwitchYardExtension.SUBSYSTEM_NAME), PathElement.pathElement(EXTENSION, identifier));
    moduleAdd.get(OP_ADDR).set(addr.toModelNode());

    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        throw unexpectedElement(reader);
    }

    list.add(moduleAdd);
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:31,代码来源:SwitchYardSubsystemReader.java

示例13: parseNativeManagementSocketBinding

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void parseNativeManagementSocketBinding(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException {

        // Handle attributes
        boolean hasRef = false;
        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 NATIVE: {
                        NativeManagementResourceDefinition.SOCKET_BINDING.parseAndSetParameter(value, addOp, reader);
                        hasRef = true;
                        break;
                    }
                    default:
                        throw unexpectedAttribute(reader, i);
                }
            }
        }

        if (!hasRef) {
            throw missingRequired(reader, Collections.singleton(Attribute.REF.getLocalName()));
        }

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

示例14: parsePlugIn_Authorization

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void parsePlugIn_Authorization(final XMLExtendedStreamReader reader,
        final ModelNode parentAddress, final List<ModelNode> list) throws XMLStreamException {
    ModelNode addr = parentAddress.clone().add(PLUG_IN);
    ModelNode plugIn = Util.getEmptyOperation(ADD, addr);
    list.add(plugIn);

    requireSingleAttribute(reader, Attribute.NAME.getLocalName());
    // After double checking the name of the only attribute we can retrieve it.
    final String plugInName = reader.getAttributeValue(0);
    plugIn.get(NAME).set(plugInName);

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

示例15: parseNativeManagementInterfaceAttributes

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void parseNativeManagementInterfaceAttributes(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_AUTHENTICATION_FACTORY: {
                    NativeManagementResourceDefinition.SASL_AUTHENTICATION_FACTORY.parseAndSetParameter(value, addOp, reader);
                    break;
                }
                case SASL_PROTOCOL: {
                    NativeManagementResourceDefinition.SASL_PROTOCOL.parseAndSetParameter(value, addOp, reader);
                    break;
                }
                case SECURITY_REALM: {
                    NativeManagementResourceDefinition.SECURITY_REALM.parseAndSetParameter(value, addOp, reader);
                    break;
                }
                case SERVER_NAME: {
                    NativeManagementResourceDefinition.SERVER_NAME.parseAndSetParameter(value, addOp, reader);
                    break;
                }
                case SSL_CONTEXT: {
                    NativeManagementResourceDefinition.SSL_CONTEXT.parseAndSetParameter(value, addOp, reader);
                    break;
                }
                default:
                    throw unexpectedAttribute(reader, i);
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:36,代码来源:StandaloneXml_5.java


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