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


Java XMLExtendedStreamReader.getAttributeCount方法代码示例

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


在下文中一共展示了XMLExtendedStreamReader.getAttributeCount方法的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: parseHostRelease

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

        boolean sawId = false;
        final int count = reader.getAttributeCount();
        for (int i = 0; i < count; i++) {

            final String value = reader.getAttributeValue(i);
            if (!isNoNamespaceAttribute(reader, i)) {
                throw ParseUtils.unexpectedAttribute(reader, i);
            }

            final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
            if (attribute == Attribute.ID) {
                sawId = true;
                HostExcludeResourceDefinition.HOST_RELEASE.parseAndSetParameter(value, addOp, reader);
            } else {
                throw unexpectedAttribute(reader, i);
            }
        }

        if (!sawId) {
            throw missingRequired(reader, Attribute.ID.getLocalName());
        }

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

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

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

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

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

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

示例12: parsePropertiesAuthorization

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

    String path = null;

    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 PATH:
                    path = value;
                    PropertiesAuthorizationResourceDefinition.PATH.parseAndSetParameter(value, properties, reader);
                    break;
                case RELATIVE_TO: {
                    PropertiesAuthorizationResourceDefinition.RELATIVE_TO.parseAndSetParameter(value, properties, reader);
                    break;
                }
                default: {
                    throw unexpectedAttribute(reader, i);
                }
            }
        }
    }

    if (path == null)
        throw missingRequired(reader, Collections.singleton(Attribute.PATH));

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

示例13: parseNativeManagementSocket

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
private void parseNativeManagementSocket(XMLExtendedStreamReader reader, ModelNode addOp) throws XMLStreamException {
    // Handle attributes
    boolean hasInterface = 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 INTERFACE: {
                    NativeManagementResourceDefinition.INTERFACE.parseAndSetParameter(value, addOp, reader);
                    hasInterface = true;
                    break;
                }
                case PORT: {
                    NativeManagementResourceDefinition.NATIVE_PORT.parseAndSetParameter(value, addOp, reader);
                    break;
                }
                default:
                    throw unexpectedAttribute(reader, i);
            }
        }
    }

    requireNoContent(reader);

    if (!hasInterface) {
        throw missingRequired(reader, Collections.singleton(Attribute.INTERFACE.getLocalName()));
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:34,代码来源:HostXml_4.java

示例14: 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_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;
                }
                default:
                    throw unexpectedAttribute(reader, i);
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:28,代码来源:HostXml_4.java

示例15: parseDiscoveryOptionProperty

import org.jboss.staxmapper.XMLExtendedStreamReader; //导入方法依赖的package包/类
protected void parseDiscoveryOptionProperty(XMLExtendedStreamReader reader, ModelNode discoveryOptionProperties) throws XMLStreamException {
    String propertyName = null;
    String propertyValue = null;
    EnumSet<Attribute> required = EnumSet.of(Attribute.NAME, Attribute.VALUE);
    final int count = reader.getAttributeCount();
    for (int i = 0; i < count; i++) {
        requireNoNamespaceAttribute(reader, i);
        final String value = reader.getAttributeValue(i);
        final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
        required.remove(attribute);
        switch (attribute) {
            case NAME: {
                propertyName = value;
                break;
            }
            case VALUE: {
                propertyValue = value;
                break;
            }
            default:
                throw unexpectedAttribute(reader, i);
        }
    }

    if (required.size() > 0) {
        throw missingRequired(reader, required);
    }

    discoveryOptionProperties.add(propertyName, propertyValue);
    requireNoContent(reader);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:32,代码来源:HostXml_6.java


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