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


Java ParseUtils.requireNoContent方法代码示例

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


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

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

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

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

示例4: readCustomConfigurationProperty

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

示例5: readElement

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
    // Require no content
    ParseUtils.requireNoContent(reader);
    list.add(Util.createAddOperation(PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, SUBSYSTEM_NAME))));
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:8,代码来源:OtherServicesSubsystemExtension.java

示例6: readElement

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

    ModelNode subsystemAddress = SubsystemExtension.createSubsystemAddress();

    list.add(SubsystemExtension.createAddSubsystemOperation(subsystemAddress));

    while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
        switch (Namespace.forUri(reader.getNamespaceURI())) {
            case LOGSTASH_GELF_1_0: {
                final Element element = Element.forName(reader.getLocalName());
                switch (element) {
                    case DATENPUMPE: {
                        SubsystemExtension.prepareOperation(ModelConstants.DATENPUMPE, reader, list, subsystemAddress);
                        ParseUtils.requireNoContent(reader);
                        break;
                    }

                    case SENDER: {
                        SubsystemExtension.prepareOperation(ModelConstants.SENDER, reader, list, subsystemAddress);
                        ParseUtils.requireNoContent(reader);
                        break;
                    }
                    default: {
                        reader.handleAny(list);
                        break;
                    }
                }
                break;
            }
            default:
                throw ParseUtils.unexpectedElement(reader);
        }
    }
}
 
开发者ID:mp911de,项目名称:logstash-gelf-subsystem,代码行数:40,代码来源:SubsystemParser.java

示例7: readElement

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
@Override
public void readElement(XMLExtendedStreamReader reader,
        List<ModelNode> ops) throws XMLStreamException {
    ParseUtils.requireNoAttributes(reader);
    ParseUtils.requireNoContent(reader);
    ops.add(Util.createAddOperation(PathAddress.pathAddress(CliExtCommandsSubsystemResourceDescription.PATH)));
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:8,代码来源:CliExtCommandsParser.java

示例8: readElement

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

    ModelNode subsystemAdd = Util.createAddOperation(PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, SUBSYSTEM_NAME)));
    subsystemAdd.get("test").set("Hello");
    subsystemAdd.get("properties", "one").set("A");
    subsystemAdd.get("properties", "two").set("B");

    list.add(subsystemAdd);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:13,代码来源:NewExtension.java

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

示例10: parseShowModelElement

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
protected ModelNode parseShowModelElement(XMLExtendedStreamReader reader, String showModelChild) throws XMLStreamException {

            ModelNode op = createOperation(ADD, CommonAttributes.EXPOSE_MODEL, showModelChild);

            String domainName = null;
            Boolean properPropertyFormat = null;

            for (int i = 0; i < reader.getAttributeCount(); i++) {
                final String value = reader.getAttributeValue(i);
                final String attribute = reader.getAttributeLocalName(i);
                switch (attribute) {
                    case CommonAttributes.DOMAIN_NAME:
                        ExposeModelResource.getDomainNameAttribute(showModelChild).parseAndSetParameter(value, op, reader);
                        break;
                    case CommonAttributes.PROPER_PROPERTY_FORMAT:
                        if (showModelChild.equals(CommonAttributes.RESOLVED)) {
                            ExposeModelResourceResolved.PROPER_PROPERTY_FORMAT.parseAndSetParameter(value, op, reader);
                        } else {
                            throw ParseUtils.unexpectedAttribute(reader, i);
                        }
                        break;
                    default:
                        throw ParseUtils.unexpectedAttribute(reader, i);
                }
            }

            if (domainName == null && properPropertyFormat == null) {
                ParseUtils.requireNoContent(reader);
            }
            return op;
        }
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:32,代码来源:JMXExtension.java

示例11: parseAuditLogHandler

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

            String name = null;
            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 NAME:
                        name = value;
                        break;
                    default:
                        throw ParseUtils.unexpectedAttribute(reader, i);
                }
            }

            if (name == null) {
                throw ParseUtils.missingRequired(reader, Collections.singleton(NAME));
            }
            ModelNode op = createOperation(ADD,
                    JmxAuditLoggerResourceDefinition.PATH_ELEMENT.getKey(),
                    JmxAuditLoggerResourceDefinition.PATH_ELEMENT.getValue(),
                    JmxAuditLogHandlerReferenceResourceDefinition.PATH_ELEMENT.getKey(), name);
            list.add(op);

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

示例12: readElement

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void readElement(XMLExtendedStreamReader reader, List<ModelNode> list) throws XMLStreamException {
    // Require no content
    ParseUtils.requireNoContent(reader);
    list.add(createAddSubsystemOperation());
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:8,代码来源:ValidateSubsystemExtension.java

示例13: parseAndSetParameter

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

        ModelNode model = new ModelNode();

        final int attrCount = reader.getAttributeCount();
        Set<Attribute> required = EnumSet.of(Attribute.TIME, Attribute.UNIT);
        for (int i = 0; i < attrCount; i++) {
            requireNoNamespaceAttribute(reader, i);
            final String value = reader.getAttributeValue(i);
            final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
            required.remove(attribute);
            switch (attribute) {
                case TIME: {
                    KEEPALIVE_TIME_TIME.parseAndSetParameter(value, model, reader);
                    break;
                }
                case UNIT: {
                    KEEPALIVE_TIME_UNIT.parseAndSetParameter(value, model, reader);
                    break;
                }
                default:
                    throw unexpectedAttribute(reader, i);
            }
        }

        if (!required.isEmpty()) {
            throw missingRequired(reader, required);
        }

        ParseUtils.requireNoContent(reader);

        operation.get(getName()).set(model);
    }
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:34,代码来源:KeepAliveTimeAttributeDefinition.java

示例14: readElement

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

    ModelNode subsystemAdd = Util.createAddOperation(PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, SUBSYSTEM_NAME)));
    subsystemAdd.get("test-attribute").set("This is only a test");
    list.add(subsystemAdd);

    addChildElements(list);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:12,代码来源:VersionedExtensionCommon.java

示例15: parseProperty

import org.jboss.as.controller.parsing.ParseUtils; //导入方法依赖的package包/类
static void parseProperty(XMLExtendedStreamReader reader, PathAddress parent, List<ModelNode> list)
        throws XMLStreamException {
    String name = null;
    final ModelNode property = new ModelNode();

    final int count = reader.getAttributeCount();
    for (int i = 0; i < count; i++) {
        requireNoNamespaceAttribute(reader, i);
        final String attribute = reader.getAttributeLocalName(i);
        final String value = reader.getAttributeValue(i);
        switch (SmppMbeanPropertyDefinition.Element.of(attribute)) {
            case NAME: {
                name = value;
                SmppMbeanPropertyDefinition.NAME_ATTR.parseAndSetParameter(value, property, reader);
                break;
            }
            case TYPE: {
                SmppMbeanPropertyDefinition.TYPE_ATTR.parseAndSetParameter(value, property, reader);
                break;
            }
            case VALUE: {
                SmppMbeanPropertyDefinition.VALUE_ATTR.parseAndSetParameter(value, property, reader);
                break;
            }
            default: {
                throw unexpectedAttribute(reader, i);
            }
        }
    }

    ParseUtils.requireNoContent(reader);

    if (name == null) {
        throw missingRequired(reader, Collections.singleton(Attribute.NAME));
    }

    property.get(OP).set(ADD);
    PathAddress address = PathAddress.pathAddress(parent,
            PathElement.pathElement(SmppMbeanPropertyDefinition.PROPERTY, name));
    property.get(OP_ADDR).set(address.toModelNode());
    list.add(property);
}
 
开发者ID:RestComm,项目名称:smpp-extensions,代码行数:43,代码来源:SmppSubsystemParser.java


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