• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ParseUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ParseUtils类属于org.jboss.as.controller.parsing包,在下文中一共展示了ParseUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: readElement

import org.jboss.as.controller.parsing.ParseUtils; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
    ParseUtils.requireNoAttributes(reader);

    final PathAddress address = PathAddress.pathAddress(OpenShiftSubsystemExtension.SUBSYSTEM_PATH);
    final ModelNode subsystem = Util.getEmptyOperation(ADD, address.toModelNode());
    list.add(subsystem);

    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        if(reader.getLocalName().equals(Constants.MAX_LINE_LENGTH)) {
            final String value = parseElementNoAttributes(reader);
            OpenShiftSubsystemDefinition.MAX_LINE_LENGTH.parseAndSetParameter(value, subsystem, reader);
        } else if(reader.getLocalName().equals(Constants.METRICS_GROUP)) {
            readMetricsGroups(reader, address, list);
        } else {
            throw ParseUtils.unexpectedElement(reader);
        }
    }
}
 
开发者ID:ncdc,项目名称:jboss-openshift-metrics-module,代码行数:23,代码来源:OpenShiftSubsystemParser.java


示例7: readElement

import org.jboss.as.controller.parsing.ParseUtils; //导入依赖的package包/类
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
    ParseUtils.requireNoAttributes(reader);
    list.add(Util.createAddOperation(PathAddress.pathAddress(ModelDescriptionConstants.SUBSYSTEM, SUBSYSTEM_NAME)));

    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        final String element = reader.getLocalName();
        switch (element) {
            case "child": {
                list.add(parseChild(reader));
                break;
            }
            default: {
                throw ParseUtils.unexpectedElement(reader);
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:19,代码来源:OrderedChildResourceExtension.java


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


示例9: readElement

import org.jboss.as.controller.parsing.ParseUtils; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
    ParseUtils.requireNoAttributes(reader);
    list.add(createAddOperation());

    boolean gotConnector = false;

    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        final String element = reader.getLocalName();
        switch (element) {
            case CommonAttributes.JMX_CONNECTOR: {
                if (gotConnector) {
                    throw ParseUtils.duplicateNamedElement(reader, CommonAttributes.JMX_CONNECTOR);
                }
                parseConnector(reader);
                gotConnector = true;
                break;
            }
            default: {
                throw ParseUtils.unexpectedElement(reader);
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:28,代码来源:JMXExtension.java


示例10: parseRemoteConnector

import org.jboss.as.controller.parsing.ParseUtils; //导入依赖的package包/类
protected ModelNode parseRemoteConnector(final XMLExtendedStreamReader reader) throws XMLStreamException {

            final ModelNode connector = new ModelNode();
            connector.get(OP).set(ADD);
            connector.get(OP_ADDR).add(SUBSYSTEM, JMX).add(REMOTING_CONNECTOR, CommonAttributes.JMX);

            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.USE_MANAGEMENT_ENDPOINT: {
                        RemotingConnectorResource.USE_MANAGEMENT_ENDPOINT.parseAndSetParameter(value, connector, reader);
                        break;
                    }
                    default: {
                        throw ParseUtils.unexpectedAttribute(reader, i);
                    }
                }
            }

            ParseUtils.requireNoContent(reader);
            return connector;
        }
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:25,代码来源:JMXExtension.java


示例11: parseSensitivity

import org.jboss.as.controller.parsing.ParseUtils; //导入依赖的package包/类
private void parseSensitivity(ModelNode add, XMLExtendedStreamReader reader) throws XMLStreamException {
    final 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.NON_CORE_MBEANS:
                JMXSubsystemRootResource.CORE_MBEAN_SENSITIVITY.parseAndSetParameter(value, add, reader);
                break;
            default:
                throw ParseUtils.unexpectedAttribute(reader, i);
        }
    }

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


示例12: parseServerGroupScopedRoles

import org.jboss.as.controller.parsing.ParseUtils; //导入依赖的package包/类
public void parseServerGroupScopedRoles(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list) throws XMLStreamException {

        ParseUtils.requireNoAttributes(reader);

        String scopedRoleType = ServerGroupScopedRoleResourceDefinition.PATH_ELEMENT.getKey();

        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            requireNamespace(reader, namespace);
            final Element element = Element.forName(reader.getLocalName());
            switch (element) {
                case ROLE: {
                    parseScopedRole(reader, address, list, scopedRoleType, Element.SERVER_GROUP,
                            ServerGroupScopedRoleResourceDefinition.BASE_ROLE, ServerGroupScopedRoleResourceDefinition.SERVER_GROUPS, true);
                    break;
                }
                default: {
                    throw unexpectedElement(reader);
                }
            }
        }
    }
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:AccessControlXml.java


示例13: parseHostScopedRoles

import org.jboss.as.controller.parsing.ParseUtils; //导入依赖的package包/类
public void parseHostScopedRoles(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list) throws XMLStreamException {

        ParseUtils.requireNoAttributes(reader);

        String scopedRoleType = HostScopedRolesResourceDefinition.PATH_ELEMENT.getKey();

        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            requireNamespace(reader, namespace);
            final Element element = Element.forName(reader.getLocalName());
            switch (element) {
                case ROLE: {
                    parseScopedRole(reader, address, list, scopedRoleType, Element.HOST,
                            HostScopedRolesResourceDefinition.BASE_ROLE, HostScopedRolesResourceDefinition.HOSTS, false);
                    break;
                }
                default: {
                    throw unexpectedElement(reader);
                }
            }
        }

    }
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:23,代码来源:AccessControlXml.java


示例14: parseIncludeExclude

import org.jboss.as.controller.parsing.ParseUtils; //导入依赖的package包/类
private void parseIncludeExclude(final XMLExtendedStreamReader reader, final ModelNode parentAddress, final String incExcType,
        final List<ModelNode> list) throws XMLStreamException {
    ParseUtils.requireNoAttributes(reader);

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


示例15: parseSensitiveClassifications

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

    ParseUtils.requireNoAttributes(reader);

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


示例16: parseApplicationClassifications

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

    ParseUtils.requireNoAttributes(reader);

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


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


示例18: parseEnvironmentVariables

import org.jboss.as.controller.parsing.ParseUtils; //导入依赖的package包/类
public static ModelNode parseEnvironmentVariables(final XMLExtendedStreamReader reader, final Namespace expectedNs, ModelNode addOp) throws XMLStreamException {
    final ModelNode properties = new ModelNode();
    while (reader.nextTag() != END_ELEMENT) {
        requireNamespace(reader, expectedNs);
        if (Element.forName(reader.getLocalName()) != Element.VARIABLE) {
            throw unexpectedElement(reader);
        }
        final String[] array = requireAttributes(reader, Attribute.NAME.getLocalName(), Attribute.VALUE.getLocalName());
        requireNoContent(reader);
        properties.get(array[0]).set(ParseUtils.parsePossibleExpression(array[1]));
    }

    if (!properties.isDefined()) {
        throw missingRequiredElement(reader, Collections.singleton(Element.OPTION));
    }
    addOp.get(JvmAttributes.JVM_ENV_VARIABLES).set(properties);
    return properties;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:19,代码来源:JvmXml.java


示例19: parseElement

import org.jboss.as.controller.parsing.ParseUtils; //导入依赖的package包/类
@Override
public void parseElement(AttributeDefinition attribute, XMLExtendedStreamReader reader, ModelNode operation) throws XMLStreamException {
    ObjectTypeAttributeDefinition objectType = getObjectType(attribute);

    ModelNode listValue = operation.get(attribute.getName());
    if (!listValue.isDefined()){
        listValue.setEmptyList();
    }
    String xmlName = objectType.getXmlName();
    if (xmlName.equals(reader.getLocalName())) {
        ModelNode op = listValue.add();
        parseEmbeddedElement(objectType, reader, op);
    } else {
        throw ParseUtils.unexpectedElement(reader, Collections.singleton(xmlName));
    }
    if (!reader.isEndElement()) {
        ParseUtils.requireNoContent(reader);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:20,代码来源:AttributeParsers.java


示例20: parse

import org.jboss.as.controller.parsing.ParseUtils; //导入依赖的package包/类
/**
 * Parse xml from provided <code>reader</code> and add resulting operations to passed list
 * @param reader xml reader to parse from
 * @param parentAddress address of the parent, used as base for all child elements
 * @param list list of operations where result will be put to.
 * @throws XMLStreamException if any error occurs while parsing
 */
public void parse(final XMLExtendedStreamReader reader, PathAddress parentAddress, List<ModelNode> list) throws XMLStreamException {
    if (decoratorElement != null) {
        parseDecorator(reader, parentAddress, list);
        return;
    }
    if (xmlWrapperElement != null) {
        if (reader.getLocalName().equals(xmlWrapperElement)) {
            if (reader.hasNext() && reader.nextTag() == END_ELEMENT) { return; }
        } else {
            throw ParseUtils.unexpectedElement(reader);
        }
        parseInternal(reader, parentAddress, list);
        while (reader.nextTag() != END_ELEMENT && !reader.getLocalName().equals(xmlWrapperElement)) {
            parseInternal(reader, parentAddress, list);
        }
    } else {
        parseInternal(reader, parentAddress, list);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:27,代码来源:PersistentResourceXMLDescription.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TableListener类代码示例发布时间:2022-05-22
下一篇:
Java AbstractRegionPainter类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap