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


Java ParseUtils.unexpectedAttribute方法代码示例

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


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

示例1: parseObjectReplicator

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的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.as.controller.parsing.ParseUtils; //导入方法依赖的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.as.controller.parsing.ParseUtils; //导入方法依赖的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.as.controller.parsing.ParseUtils; //导入方法依赖的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.as.controller.parsing.ParseUtils; //导入方法依赖的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: parseChild

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
private ModelNode parseChild(XMLExtendedStreamReader reader) throws XMLStreamException {
    ModelNode add = null;
    int count = reader.getAttributeCount();
    for (int i = 0; i < count; i++) {
        final String value = reader.getAttributeValue(i);
        final String attribute = reader.getAttributeLocalName(i);
        switch (attribute) {
            case "name": {
                add = Util.createAddOperation(PathAddress.pathAddress(
                        PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, SUBSYSTEM_NAME),
                        PathElement.pathElement("child", value)));
                break;
            }
            default: {
                throw ParseUtils.unexpectedAttribute(reader, i);
            }
        }
    }
    if (add == null) {
        throw ParseUtils.missingRequired(reader, Collections.singleton("child"));
    }
    // Require no content
    ParseUtils.requireNoContent(reader);
    return add;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:OrderedChildResourceExtension.java

示例7: parseHostRelease

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的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_5.java

示例8: parseAuthentication

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的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.as.controller.parsing.ParseUtils; //导入方法依赖的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.as.controller.parsing.ParseUtils; //导入方法依赖的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: readMetricsGroups

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
private void readMetricsGroups(XMLExtendedStreamReader reader, PathAddress parentAddress, List<ModelNode> list) throws XMLStreamException {
    final ModelNode addScheduleOperation = Util.getEmptyOperation(ADD, null);
    String schedule = null;

    for (int i = 0; i < reader.getAttributeCount(); i++) {
        String attr = reader.getAttributeLocalName(i);
        String value = reader.getAttributeValue(i);

        if(Constants.CRON.equals(attr)) {
            schedule = com.openshift.metrics.extension.Util.encodeCronExpression(value);
        } else if(Constants.ENABLED.equals(attr)) {
            MetricsGroupDefinition.ENABLED.parseAndSetParameter(value, addScheduleOperation, reader);
        } else {
            throw ParseUtils.unexpectedAttribute(reader, i);
        }
    }

    final PathAddress address = parentAddress.append(PathElement.pathElement(Constants.METRICS_GROUP, schedule));
    addScheduleOperation.get(OP_ADDR).set(address.toModelNode());
    list.add(addScheduleOperation);

    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        if(!reader.getLocalName().equals(Constants.SOURCE)) {
            throw ParseUtils.unexpectedElement(reader);
        }
        readSource(reader, address, list);
    }
}
 
开发者ID:ncdc,项目名称:jboss-openshift-metrics-module,代码行数:29,代码来源:OpenShiftSubsystemParser.java

示例12: parseLaunchCommand

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
private static void parseLaunchCommand(final XMLExtendedStreamReader reader, ModelNode addOp)
        throws XMLStreamException {

    // Handle attributes
    boolean valueSet = 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);
        } else {
            final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
            switch (attribute) {
                case PREFIX: {
                    if (checkParseAndSetParameter(JvmAttributes.LAUNCH_COMMAND, value, addOp, reader)) {
                        throw ParseUtils.duplicateNamedElement(reader, reader.getLocalName());
                    }
                    valueSet = true;
                    break;
                }
                default:
                    throw ParseUtils.unexpectedAttribute(reader, i);
            }
        }
    }
    if (!valueSet) {
        throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.PREFIX));
    }
    // Handle elements
    requireNoContent(reader);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:32,代码来源:JvmXml.java

示例13: parseStack

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
private static void parseStack(final XMLExtendedStreamReader reader, ModelNode addOp)
        throws XMLStreamException {

    // Handle attributes
    boolean sizeSet = 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);
        } else {
            final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
            switch (attribute) {
                case SIZE: {
                    sizeSet = true;
                    if (checkParseAndSetParameter(JvmAttributes.STACK_SIZE, value, addOp, reader)){
                        throw ParseUtils.duplicateNamedElement(reader, reader.getLocalName());

                    }
                    break;
                }
                default:
                    throw ParseUtils.unexpectedAttribute(reader, i);
            }
        }
    }
    if (!sizeSet) {
        throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.SIZE));
    }
    // Handle elements
    requireNoContent(reader);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:33,代码来源:JvmXml.java

示例14: parseConnector

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
void parseConnector(XMLExtendedStreamReader reader) throws XMLStreamException {
    JmxLogger.ROOT_LOGGER.jmxConnectorNotSupported();
    String serverBinding = null;
    String registryBinding = null;
    int count = reader.getAttributeCount();
    for (int i = 0; i < count; i++) {
        final String value = reader.getAttributeValue(i);
        final String attribute = reader.getAttributeLocalName(i);
        switch (attribute) {
            case CommonAttributes.SERVER_BINDING: {
                serverBinding = value;
                break;
            }
            case CommonAttributes.REGISTRY_BINDING: {
                registryBinding = value;
                break;
            }
            default: {
                throw ParseUtils.unexpectedAttribute(reader, i);
            }
        }
    }
    // Require no content
    ParseUtils.requireNoContent(reader);
    if (serverBinding == null) {
        throw ParseUtils.missingRequired(reader, Collections.singleton(CommonAttributes.SERVER_BINDING));
    }
    if (registryBinding == null) {
        throw ParseUtils.missingRequired(reader, Collections.singleton(CommonAttributes.REGISTRY_BINDING));
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:32,代码来源:JMXExtension.java

示例15: parseJavaagent

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
private static void parseJavaagent(final XMLExtendedStreamReader reader, ModelNode addOp)
        throws XMLStreamException {

    // Handle attributes
    boolean valueSet = 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);
        } else {
            final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
            switch (attribute) {
                case VALUE: {
                    if (checkParseAndSetParameter(JvmAttributes.JAVA_AGENT, value, addOp, reader)) {
                        throw ParseUtils.duplicateNamedElement(reader, reader.getLocalName());
                    }
                    valueSet = true;
                    break;
                }
                default:
                    throw ParseUtils.unexpectedAttribute(reader, i);
            }
        }
    }
    if (!valueSet) {
        throw ParseUtils.missingRequired(reader, Collections.singleton(Attribute.VALUE));
    }
    // Handle elements
    requireNoContent(reader);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:32,代码来源:JvmXml.java


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